[Openmcl-devel] non-terminating macro character after Sharpsign Colon
Anton Vodonosov
avodonosov at yandex.ru
Thu Feb 21 17:45:05 PST 2013
Hello.
I set $ as a non-terminating macro characters.To smiplify the example,
let the macro function for that character to be a dummy one:
(set-macro-character #\$
(lambda (stream char) :x)
t
*readtable*)
When $ is a macro character, CCL's reader rejects uninterned symbols
starting from $, for example #:$, #:$asdf.
It signals error:
Reader error: Illegal symbol syntax.
[Condition of type SIMPLE-ERROR]
Restarts:
0: [RETRY] Retry SLIME interactive evaluation request.
1: [*ABORT] Return to SLIME's top level.
2: [ABORT-BREAK] Reset this thread
3: [ABORT] Kill this thread
Backtrace:
0: (CCL::READ-SYMBOL-TOKEN #<STRING-INPUT-STREAM #x2100D7ECED>)
1: (#<Anonymous Function #x1004DA5FF> #<STRING-INPUT-STREAM #x2100D7ECED> #\: NIL)
2: (CCL::READ-DISPATCH #<STRING-INPUT-STREAM #x2100D7ECED> #\#)
3: (CCL::%PARSE-EXPRESSION #<STRING-INPUT-STREAM #x2100D7ECED> #\# NIL)
4: (CCL::%READ-FORM #<STRING-INPUT-STREAM #x2100D7ECED> 0 NIL)
5: (CCL::READ-INTERNAL #<STRING-INPUT-STREAM #x2100D7ECED> T NIL NIL)
6: (READ #<STRING-INPUT-STREAM #x2100D7ECED> T NIL NIL)
7: (READ-FROM-STRING "#:$" T NIL :START 0 :END NIL :PRESERVE-WHITESPACE NIL)
8: ((:INTERNAL SWANK::FROM-STRING))
Why it is so? After all, the macro character is non-terminating, so in the middle
of the tocken it should have no effect.
I have tested on other lisps. SBCL and ABCL read #:$ without problems.
CLISP on the other hand, like CCL can't read #:$.
Best regards,
- Anton
More information about the Openmcl-devel
mailing list