From 2467edf67e177707013ffa8e71b3d966735495ab Mon Sep 17 00:00:00 2001 From: David Vazquez Date: Tue, 18 Dec 2012 01:47:37 +0000 Subject: [PATCH] Character reader --- lispstrack.lisp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lispstrack.lisp b/lispstrack.lisp index b53db0a..9e864b5 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -153,23 +153,26 @@ (#\' (list 'function (ls-read stream))) (#\\ - (%read-char stream)) + (let ((cname (read-until stream #'terminalp))) + (cond + ((string= cname "space") (char-code #\space)) + ((string= cname "newline") (char-code #\newline)) + (t (char-code (char cname 0)))))) (#\+ (let ((feature (read-until stream #'terminalp))) (cond ((string= feature "common-lisp") - (ls-read stream);ignore + (ls-read stream) ;ignore (ls-read stream)) ((string= feature "lispstrack") (ls-read stream)) (t - (error "Unknown reader form."))))) - )) + (error "Unknown reader form."))))))) (t (let ((string (read-until stream #'terminalp))) (if (every #'digit-char-p string) (parse-integer string) - (intern (string-upcase string)))))))) + (intern (string-upcase string))))))))) (defun ls-read-from-string (string) (ls-read (make-string-stream string))) -- 1.7.10.4