[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
CC: (BUG LISPM) at MIT-MC
Date: Mon ,30 Jun 80 12:26:00 EDT
From: johan at MIT-AI (Johan de Kleer)
To: (BUG LISPM) at MIT-AI
In system 29.95 NWS, with microcode 669, on Xerox Machine 1:
[1] In compiling (selectq var (#,bar ...) ...) the compiler makes the
assumption that bar is a list, this is wrong. In this situation a
better thing to do is for the compiled code to first test bar's type and
then do an eq or memq depending on that type.
Bleagh, that would surely be wrong; the listification in selectq is
syntactic, not a run time thing. There is no good solution to this,
as far as I can tell; we are paying a price here for excessive use of
syntax. A suitable kludge is to put an extra level of parentheses around
the #,bar to ensure that the macro cannot think it is a list.
[2] For my application however when I have #,bar I want bar to be
evaluated at read time within the package of the file that is being
compiled. The defs file for that package will have set that variable
to something reasonable.
Use #. to get something evaluated at read time. You will still have similar
problems with SELECTQ in that the expansion of the macro will vary depending
on whether or not the value of BAR is a list.
Perhaps what you really want is SELECT, i.e.
(SELECT var
(BAR ...)
...)