I'm learning clisp at the university and in one of the textbook, when learning about characters, encoding and so on, I am taught that
> #\newline #\nEWLINE > #\space #\sPACE > #\a #\a
> (setq *print-escape* t) t > #\newline > #\space > #\a a
The problem that I have is that I installed clisp (version 1:2.49-8.1) on Debian Wheezy and I don't get the same results at all but the exact opposite: - print-escape returns t for me by default - the character are printed as characters (ie #\a => #\a) with print-escape being set to t and as they "really" are (ie #\a => a) after I set print-escape to nil.
So sounds like there's a mistake in the course material right? Or are there any other clisp top level variables that could have an influence on this and that might be set differently in Debian so that I get the exact opposite result / behavior?
You can look up the Common Lisp standard (CLisp is an implementation of Common Lisp) at the Common Lisp Hyperspec (search for CLHS *print-escape*
, or use the search at http://l1sp.org, or use http://l1sp.org/cl/*print-escape*
).
The standard says that it is bound to t
by default and that an implementation attempts to print things in such a way that read
ing them back in produces a value that is equal
to the one printed.
The CLisp implementation notes (http://www.clisp.org/impnotes.html) make no mention of characters in conjunction with *print-escape*
. Since it does make a serious attempt to print read
ably in many other cases, I think that what you see is the expected and intended behaviour.
There is much implementation dependency in this however. For example, #\space
might be printed as #\
(sharpsign backslash space) by other implementations.