jscl
jscl copied to clipboard
Reader needs to skip comments sometimes
The reader does not know how to skip comments. It skipped semicolon comments but now it needs to be done properly.
'(1 2 #| foo |# . 3)
Is this bug resolved after #159? If not then I don't understand this testcase.
With #159 applied, JSCL hangs when given '(1 2 . #| foo |#), as it does with '(1 2 . ), as there is nothing following the .. What is the expected behavior here? And if it should be different, surely that is a problem with the . syntax rather than the comment syntax?
Sorry, I updated the description. The code was wrong.
For example, compare:
(ls-read-from-string "(1 2 ;foo
. 3)") ; => (1 2 . 3)
to
(ls-read-from-string "(1 2 #|foo|#
. 3)") ; => (1 2 |.| 3)
Right, that makes sense. How to resolve this? I see that the reason this is happening is that semicolon comments are skipped in SKIP-WHITESPACES-AND-COMMENTS, which is called in the middle of reading lists. Should the #| |# code be added into this function, or are you planning on overhauling the code so this does not need to be special-cased?