From 7367b7fbf93093fc9c255ac973dfc5c569e83267 Mon Sep 17 00:00:00 2001 From: David Vazquez Date: Sun, 16 Dec 2012 22:58:34 +0000 Subject: [PATCH] Define reader #+common-lisp and #+lispstrack to compile conditionally --- lispstrack.lisp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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) -- 1.7.10.4