[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sharp plus question
Date: Fri, 19 Dec 86 11:59 EST
From: Don Morrison <dfm@JASPER.Palladian.COM>
What should the second form in the following read as?
(push :mumble *features*)
'(#-mumble #+mumble 1 2 3)
I would expect '(2 3). Both implementations I've tried read '(3), which
is completely unintuitive to me. Such a thing can easily come up in real
life (e.g. commenting out with #+(or) something that's already under
#+mumble).
Don Morrison
Palladian Software, Inc.
This is curious. In the Symbolics 7.0 implementation,
'(#+non-existent-feature #-non-existent-feature 1 2 3)
'(#-non-existent-feature #+non-existent-feature 1 2 3)
'(#+LISPM #-LISPM 1 2 3)
each read as '(2 3) but
'(#-LISPM #+LISPM 1 2 3)
does read as '(3). This does seem wrong on the following grounds:
#-LISPM goes into the mode "read me a form, and ignore it." It
recursively invokes the reader.
The reader gets #+LISPM. #+LISPM goes into the mode "read
me a form and don't ignore it." This recursively invokes
the reader.
The reader reads 1.
#+LISPM does not ignore the 1, so it returns it as the thing
read.
#-LISPM is given 1 as the result of the read, and ignores it.
2 and 3 are still in the input stream, so I don't know how both
of them manage to get ignored.
[I'm not sure what the current state of our mailer is, but I think mail
addressed to DFM%JASPER@LIVE-OAK.LCS.MIT.EDU will eventually get to me.]