about summary refs log blame commit diff stats
path: root/comal.lsp
blob: 12f8d0a558b9591b408c91b660d2376919f1b5e3 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                            


                                                             
 




                                                                      
 


                                
 

                                                               
                                  






                                                             


                                                         

                                       


                                                   
 
              

                        
#!/Users/dbane/openlisp-10.9.0/uxlisp -shell
(defun error-handler (condition)
   (cond
         ((eq (class-of condition) (class <lexer-error>)) )))

(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?

(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)))

(defclass <state> () ((prog :accessor prog)
                      (env :accessor env)))
(defmethod initialize-object :after ((self <state>) initargs)
   (setf (prog self) nil)
   (setf (env self) nil))

(defun main-h ()
   (format (standard-output) "OpenCOMAL version 0.4~%~%")
   (for ((st (create (class <state>))))
        (main-loop st)))

(defun bye ()
   (format (standard-output) "See you later...~%"))

(defun main ()
   (catch 'end (main-h))
   (bye))