X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=lml.cl;h=c2ade0c0b1e2bc0b27e8233c87c5bc1cc5d609db;hb=df9d42b78c788474da7a0e25ed6989b878e9d393;hp=8efdc39a063e09a594c30b37eec09f84dc1eecc7;hpb=8f2c887a5500d1cba7c1e53e18233085de87a783;p=lml.git diff --git a/lml.cl b/lml.cl index 8efdc39..c2ade0c 100644 --- a/lml.cl +++ b/lml.cl @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: lml.cl,v 1.7 2002/09/16 09:43:51 kevin Exp $ +;;;; $Id: lml.cl,v 1.10 2002/09/16 10:00:47 kevin Exp $ ;;;; ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -204,7 +204,8 @@ (set-macro-character #\[ #'(lambda (stream char) (declare (ignore char)) - (let ((curr-string (make-array 1024 :fill-pointer 0 :adjustable t :element-type 'character)) + (let ((forms '()) + (curr-string (make-array 1024 :fill-pointer 0 :adjustable t :element-type 'character)) (got-comma nil)) (do ((ch (read-char stream t nil t) (read-char stream t nil t))) ((eql ch #\])) @@ -212,7 +213,7 @@ (if (eql ch #\() ;; Starting top-level ,( (progn - (princ curr-string) + (push `(lml-print ,curr-string) forms) (setf (fill-pointer curr-string) 0) (setq got-comma nil) (vector-push #\( curr-string) @@ -223,9 +224,13 @@ (return nil)) (vector-push-extend ch curr-string)) (vector-push-extend #\) curr-string) - (let ((result (eval (read-from-string curr-string)))) - (when result - (princ result))) + (let ((eval-string (read-from-string curr-string)) + (result (gensym))) + (push + `(let ((,res ,eval-string)) + (when ,res + (lml-print ,res))) + forms)) (setf (fill-pointer curr-string) 0)) ;; read comma, then non #\( char (progn @@ -239,7 +244,7 @@ (progn (setq got-comma nil) (vector-push-extend ch curr-string))))) - (princ curr-string)) - t)) + (push `(lml-print ,curr-string) forms) + `(progn ,@(nreverse forms)))))