blob: 99220fb5cffc2179ba2e403e2ae1dfa0075268b2 (
plain) (
tree)
|
|
;;; Not sure yet if it's a good idea or not,
;;; but I'm trying to keep the number of top-level functions the same as in OCaml.
(defun one-command (st)
(with-handler #'error-handler
(let ((l parse (read-line)))
(case (car l)
((line) (insert (cadr c)))
((p-end) (throw 'end nil)))))) ; throw and conditions are orthogonal
(defclass <state> () ((program :accessor prog)
(env :accessor env)))
(defmethod initialize-object :after ((self <state>) initargs)
(setf (program self) nil)
(setf (env self) nil))
(defun main ()
(catch 'end (lambda ()
(format (standard-output) "BASIC version 0.1
|