diff options
author | Darren Bane <darren.bane@gmail.com> | 2020-10-12 00:52:56 +0100 |
---|---|---|
committer | Darren Bane <darren.bane@gmail.com> | 2020-10-12 00:52:56 +0100 |
commit | 84d897e941a679529d4f00ea5952196c40656b5f (patch) | |
tree | ece8dcddf6802acb2af5ca95c9c606e68569e290 /cbasic.lisp | |
parent | a8b5dbd231cd839449e9e391697c8bde9ae1cede (diff) | |
download | lsp-84d897e941a679529d4f00ea5952196c40656b5f.tar.gz |
Trying to get cbasic.lisp to compile; WIP
Diffstat (limited to 'cbasic.lisp')
-rw-r--r-- | cbasic.lisp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cbasic.lisp b/cbasic.lisp index 5183859..0f2d63c 100644 --- a/cbasic.lisp +++ b/cbasic.lisp @@ -2,7 +2,7 @@ ;;; initially following the design of ;;; https://caml.inria.fr/pub/docs/oreilly-book/html/book-ora058.html ;;; then later I can optimise following -;;; https://github.com/Henry/BuddKaminInterpreters and +;;; https://github.com/Henry/BuddKaminInterpreters and *maybe* ;;; https://oleksandrmanzyuk.wordpress.com/2014/06/18/from-object-algebras-to-finally-tagless-interpreters-2/ ;;; ;;; A BASIC interpreter already exists at @@ -12,14 +12,19 @@ ;; Because this is the main package, ;; 1) ql:quickload QuickLisp dependencies and +(ql:quickload "closer-mop") ;; 2) load local dependencies here. (load "cutil.lisp") +(load "cabs-syn.lisp") +(load "clex.lisp") (load "cparse.lisp") +;; ;; Use require & defpackage in each package from then on. ;; NB: must have no circular dependencies, and topologically sort the loads. ;; -;; TODO: it's easier to just get started with ASDF +;; TODO: is it easier to just get started with ASDF? ;; ( https://lisp-lang.org/learn/writing-libraries ) +;; Although this is beyond OpenLisp. (require "cparse") (defpackage #:cbasic @@ -32,7 +37,7 @@ ;;; but try to keep the number of top-level functions the same as in OCaml. (defun one-command (st) - (format (standard-output) "> ") + (format *standard-output* "> ") (with-handler #'error-handler (let ((l (parse (read-line)))) (case (car l) @@ -47,8 +52,8 @@ (defun main () (catch 'end (lambda () - (format (standard-output) "BASIC version 0.1~%~%") + (format *standard-output* "BASIC version 0.1~%~%") (for ((st (create (class <state>)))) (catch 'error (one-command st))))) - (format (standard-output) "See you later...~%")) + (format *standard-output* "See you later...~%")) (provide "cbasic") |