about summary refs log tree commit diff stats
path: root/cbasic.lisp
diff options
context:
space:
mode:
authorDarren Bane <darren.bane@emdalo.com>2020-08-04 12:30:56 +0100
committerDarren Bane <darren.bane@emdalo.com>2020-08-04 12:30:56 +0100
commit1167e1207e3c0928f04aa3ed51fc315fb5b8729a (patch)
treeaa7d0bb009a5495f4ba524cfcbd4e36704c0d9eb /cbasic.lisp
parent546c54613a397996e3faa04173bfa73a08a6ee47 (diff)
downloadlsp-1167e1207e3c0928f04aa3ed51fc315fb5b8729a.tar.gz
Flip-flop back to CL.
Diffstat (limited to 'cbasic.lisp')
-rw-r--r--cbasic.lisp19
1 files changed, 19 insertions, 0 deletions
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 <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