; This is an "x" version of Lisp's read-eval-print loop. When the function ; read-xeval-print-loop is run, it will interactively input exprs from the ; terminal and hand them over to xeval. Note that memory is defined as a prog ; var that is sent automatically as a parameter to xeval. This means your ; xeval interpreter does not need to worry about storing memory anywhere ; permanent. You simple return memory as the second element of the list ; returned from xeval ; (defun read-xeval-print-loop () (prog (memory result) (setq memory '()) loop (princ "X>") (setq result (xeval (read) memory)) (princ (car result)) (setq memory (cadr result)) (terpri)(terpri) (go loop) ) )