From f0467d992324a56ee5fdf8c94ee2608db0a61ac3 Mon Sep 17 00:00:00 2001 From: Darren Bane Date: Mon, 1 Jun 2020 21:21:10 +0100 Subject: Making changes --- comal.lsp | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) (limited to 'comal.lsp') diff --git a/comal.lsp b/comal.lsp index 12f8d0a..571d4a6 100644 --- a/comal.lsp +++ b/comal.lsp @@ -1,22 +1,14 @@ -#!/Users/dbane/openlisp-10.9.0/uxlisp -shell -(defun error-handler (condition) - (cond - ((eq (class-of condition) (class )) ))) +#!/home/snuc/openlisp-10.9.0/uxlisp -shell -(defun one-command-h (st) - (let ((l parse (read-line))) - (case (car l) - ((line) (insert (cadr c))) - ((p-end) (throw 'end nil)))) ; ok? No condition stuff? +;;; 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 - (one-command-h st))) - -;; Should this be in (for or something since it's called -loop? -(defun main-loop (st) - (format (standard-output) "> ") - (catch 'error (one-command st))) + (let ((l parse (read-line))) + (case (car l) + ((line) (insert (cadr c))) + ((p-end) (throw 'end nil)))))) ; throw and conditions are orthogonal (defclass () ((prog :accessor prog) (env :accessor env))) @@ -24,14 +16,11 @@ (setf (prog self) nil) (setf (env self) nil)) -(defun main-h () - (format (standard-output) "OpenCOMAL version 0.4~%~%") - (for ((st (create (class )))) - (main-loop st))) - -(defun bye () - (format (standard-output) "See you later...~%")) - (defun main () - (catch 'end (main-h)) - (bye)) + (catch 'end (lambda () + (format (standard-output) "OpenCOMAL version 0.4~%~%") + (for ((st (create (class )))) + (()) + (format (standard-output) "> ") + (catch 'error (one-command st))))) + (format (standard-output) "See you later...~%")) -- cgit 1.4.1-2-gfad0