From 1167e1207e3c0928f04aa3ed51fc315fb5b8729a Mon Sep 17 00:00:00 2001 From: Darren Bane Date: Tue, 4 Aug 2020 12:30:56 +0100 Subject: Flip-flop back to CL. --- cbasic.lisp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 cbasic.lisp (limited to 'cbasic.lisp') diff --git a/cbasic.lisp b/cbasic.lisp new file mode 100644 index 0000000..99220fb --- /dev/null +++ b/cbasic.lisp @@ -0,0 +1,19 @@ +;;; 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 () ((program :accessor prog) + (env :accessor env))) +(defmethod initialize-object :after ((self ) initargs) + (setf (program self) nil) + (setf (env self) nil)) + +(defun main () + (catch 'end (lambda () + (format (standard-output) "BASIC version 0.1 -- cgit 1.4.1-2-gfad0