I think I've hit an ugly clisp bug that hits the Common Lisp implementation of 
neoteric-expressions. Has anyone seen anything like this?  Or, am I 
misunderstanding something?

Here's the details: I think clisp version  2.47 and 2.48 don't preserve any 
whitespace, even when you call "read-preserve-whitespace", immediately after 
the call.  As a result, "(a ())" and "(a())" look exactly alike, and both get 
translated to "((a))".  Similarly, "{a + {b * c}}" becomes "{a +{b * c}}".  The 
expression "(a  ())", with TWO spaces after the "a", is handled correctly.

My test script is:
(progn (write (read-preserving-whitespace *standard-input* t nil)) (write 
(peek-char)) (princ " ") (write (read-preserving-whitespace *standard-input* t 
nil)) (values))

With the input:
q56 t78
(one space between)

Running this on sbcl (Steel Bank), I get the expected:
Q56#\  T78


On GNU CLISP 2.47 (2008-10-23), I get the really-really-wrong result:
Q56#\t T78

That is, after reading the atom "q56" the following delimiting whitespace is 
*consumed* by read-preserving-whitespace.  Using TWO spaces as the separator 
makes it work fine again.

Such a bug was reported on clisp, but was reported fixed in 2008:
http://sourceforge.net/tracker/?func=detail&atid=101355&aid=1890854&group_id=1355

This could be worked around, but with pain. I prefer to avoid pain :-).

--- David A. Wheeler

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to