From: Andrea Griffini Date: Sat, 4 May 2013 08:07:02 +0000 (+0200) Subject: fixed detection of multiple objects after . in list X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=941e61178f117eb07bfd801531a05a9bd8112094;p=jscl.git fixed detection of multiple objects after . in list --- diff --git a/src/read.lisp b/src/read.lisp index 05074a4..d5a0c65 100644 --- a/src/read.lisp +++ b/src/read.lisp @@ -118,7 +118,11 @@ (discard-char stream #\.) (if (terminalp (%peek-char stream)) (prog1 (ls-read stream) ; Dotted pair notation - (discard-char stream #\))) + (skip-whitespaces-and-comments stream) + (let ((ch (%peek-char stream))) + (if (or (null ch) (char= #\) ch)) + (discard-char stream #\)) + (error "Multiple objects following . in a list")))) (let ((token (concat "." (read-escaped-until stream #'terminalp)))) (cons (interpret-token token) (%read-list stream)))))