From: David Vazquez Date: Sun, 16 Dec 2012 22:58:34 +0000 (+0000) Subject: Define reader #+common-lisp and #+lispstrack to compile conditionally X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=7367b7fbf93093fc9c255ac973dfc5c569e83267;p=jscl.git Define reader #+common-lisp and #+lispstrack to compile conditionally --- diff --git a/lispstrack.lisp b/lispstrack.lisp index 234750a..ab8118b 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -67,7 +67,7 @@ (setq ch (%peek-char stream))))) (defun terminalp (ch) - (or (null ch) (whitespacep ch) (char= #\) ch))) + (or (null ch) (whitespacep ch) (char= #\) ch) (char= #\( ch))) (defun read-until (stream func) (let ((string "") @@ -133,7 +133,17 @@ (%read-char stream) (ecase (%read-char stream) (#\' - (list 'function (ls-read stream))))) + (list 'function (ls-read stream))) + (#\+ + (let ((feature (read-until stream #'terminalp))) + (cond + ((string= feature "common-lisp") + (ls-read stream);ignore + (ls-read stream)) + ((string= feature "lispstrack") + (ls-read stream)) + (t + (error "Unknown reader form."))))))) (t (let ((string (read-until stream #'terminalp))) (if (every #'digit-char-p string)