Your project report should reflect your final product, rather than focusing on each incremental step along the way. Your project report should explain your comparison of parameter passing variations, and the functionality of your interpreter procedures that allows you to make these comparisons. Don't go into the details in English: your audience can read Scheme. You may assume your audience is familiar with the EOPL book and the supplemental notes that are on our course web page.
if
and let
expressions. (It is
Figure 5.3.2, with all the supporting code.) This interpreter is linked from the web version of
this lab handout. You can use the interpreter in either of two ways:
run
, passing in a character
string which is the expression to evaluate. For example,
(run "let x = 3 in *(x, x)")would evaluate to 9.
read-eval-print
, with no
arguments, which starts a read-eval-print loop (REPL) going for the
interpreted language. Each time it prompts, you can type in an
expression in the language. You can split the expression over as many
lines as you like, but need to type a semicolon at the end of it. For
example,
(read-eval-print) --> let n = 5 in *(n, n); 25 -->where the two arrows are prompts printed by the REPL, and the 25 is the value it prints. In Dr Scheme, the REPL takes place in a box, with the output and input in different colors. When you are done using the REPL, you can press the Break button to quit.
proc
) in section 5.4 and variable assignment in section
5.5. The parser I have provided already understands the concrete
syntax of all these kinds of expressions and produces the
corresponding ASTs (record types). For testing and debugging you may
find it useful to just parse, or just evaluate, rather than always
doing the two together. You can just evaluate using
eval-exp
, which you will be extending during the lab. To
just parse, you have two options, similar to the two options shown
above.
character-string-parser
to a string which
is an expression, and you will get back the AST as a record.
read-print
, which acts like
read-eval-print
except that it just shows the AST for
each expression you enter, rather than doing any evaluation.
let
clause, contrary to what the exercise says, if you
removed it entirely in doing exercise 5.4.4.) Also, you should add
variable assignment, as in figure 5.5.1.
add-binding-to-env!
procedure I added to the environment
ADT.
Instructor: Max Hailperin