Project #5: μScheme Interpreter

Submit: Turn in your uscheme directory using the turnin command on morbius.mscsnet.mu.edu or one of the other Systems Lab machines.

Work is to be completed in teams of two. Be certain to include both teammates names in the file "parse.c". You may submit multiple times, but only the last turnin will be kept. The automatic submission system will not accept work after the deadline.

Include a comment block at the very top of each file that contains the following:

  /* COSC 3410 - Project 5 */
  /* @author [your names] */
  /* Instructor [your instructor] */
  /* TA-BOT:MAILTO [your email addresses] */

Q1 - record

Textbook Chapter 2, section 2.16.16: Exercise #54 - Syntactic sugar for record.

Examples:
> (record tree (datum left right))
make-tree
tree?
tree-datum
tree-left
tree-right
> (val t (make-tree 1 2 3))
(make-tree 1 2 3)
> (tree? t)
#t
> (tree? 5)
#f
> (tree-datum t)
1
> (tree-left t)
2
> (tree-right t)
3

Q2 - New Primitives

Chapter 2.16.17, exercises #56 (list), #57 (apply) and #59 (read).

Examples:
> (list)
()
> (list 'a 'b 'c)
(a b c)
> (apply + '(1 2))
3
> (val lst (read))
READ> (1 2 3 4 5)
(1 2 3 4 5)

[back]

[Revised 2023 Oct 23 13:40 DWB]