Comp 372 homework 4: Lisp in Java Nov 5, 2004 Dordal Due: Nov 19, 2004 You are to take my lisp.java lisp interpreter in java and make the following additions: 1. Clean out the demo stuff and have the program run a read-eval-print loop from the beginning. (I may do this for you). 2. Add the following functions as builtins: EVAL PRINT (single arg) READ (RPLACA cons s_expr) ;; as in Common Lisp (RPLACD cons s_expr) ;; ditto 3. Allow atoms to have PROPERTY LISTS, initially NIL. Property lists have the format (key1 val1 key2 val2 ...). You will need three new builtin functions to access the property list: (GET symbol key) ;; as in common lisp (PUT symbol key value) ;; CL uses (setf (get symbol key) value) (PLIST symbol) ;; returns whole property list 4. Add a new function format NLAMBDA, defined with DEFNLAMBDA, which gets the list of actual parameters passed UNEVALUATED to the single arg. Nlambdas are, in other words, the same as SpecialForms except they are user-defined. Note that DEFNLAMBDA itself will be a new "specialform". Here is an example: (defnlambda if (arg) ;; arg is (expr iftrue iffalse) (cond ((eval (car arg)) (eval (cadr arg))) (t (eval (caddr arg)))) The explicit use of EVAL is risky, but cheap. 5. For those registered for 471 (graduate credit), add LET and DO. Hint: do LET first. The LET and DO bodies can be a single expression. Both will be specialforms.