Due: Tuesday, March 15th, 2011 9:10am
Start with miniracket4.zip.
Add support for empty as a value and a literal expression, and also an empty? predicate expression form. The empty? unary operator takes any value and produces #t if the value is empty, #f otherwise.
Add cons cells as a new kind of value, along with cons, first, and rest operators. The cons binary operator takes two values and puts them together into a cons-cell value, and the second argument must be either empty or a cons cell (otherwise cons should fail). The first unary operator takes a cons cell and extracts and returns its first value (or fails if the argument value is not a cons cells). The rest unary operator takes a cons cell and extracts and returns its second value (or fails if the argument value is not a cons cells).
Write the feed-fish function (which takes a list of numbers and returns a list of numbers each incremented by one) and call it as a test case for your MiniRacket interpreter.
Last update: Thursday, April 7th, 2011mflatt@cs.utah.edu |