lab 27 - sh sexpr
NAME lab 27 - sh sexpr DESCRIPTION The implementation of the lisp dialect in lab 26 had some problems. For each car or cdr operator I recursively descended the syntax tree rather than holding the lists in memory in a more convenient fomat and simply taking the head or tail of the list. I did not want to build further on this implementation. Instead I wanted to rewrite eval to use the sexprs (2) module and convert the sh's syntax tree to an s-expression. Converting from the syntax tree to an s-expression is pretty easy to do, though it took me a while to remember the method. The first file lisp1.b is a brute force implementation, which of course once I got working I remembered the method I should of used. % load ./lisp1 % eval {a {b} c} (a (b) c) % unload ./lisp1 The second file lisp2.b maintains a global stack of lists of sexp...