[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #\STOP-OUTPUT in Maclisp

An idea that occurred to me was to introduce a notion
of "reading a form, but not really".  The problem is more
general than #\STOP-OUTPUT.  For example, suppose one is
reading into a MacLISP: should  #+LISPM #,(QUIT)  kill your
LISP or not?
So suppose that, explicitly or implicitly, READ takes a flag saying
whether or not to *really* construct the S-expression, or just
skip over things.  #+ and #- would set the flag to the disable
state when reading the following form if the conditional fails.
When the flag is in this state:
	(1) #\ will simply read the following S-expression,
	    and complain if it isn't a symbol, but not complain
	    if it is not a known name.
	(2) #, and #. will read the following S-expression in the
	    failing state, but not evaluate.
	(3) #+ and #- will read a following name and then an S-expression,
	    both in the failing state; in particular, they cannot complain
	    if the flag name following is not known.
	(4) Numbers and symbols are pretty much undistinguished,
	    and probably have to read as symbols.  This is in case
	    one dialect supports different syntaxes for numbers;
	    then one can get away with #+QuaternionLISP 3+5i-6.7j+43.7e5k .
	(5) # followed by a character for which no macro is defined
	    probably should just quietly disappear (with the losing
	    character).  This mostly makes
		#+ScribeLISP (#@Begin[Foo] ZTESCH #@End[Foo])
	    work, though not in all cases.
Admittedly it does more than one can do with IF-FOR-LISPM --
but the point is to mostly let you get away with incompatible
syntax as well as semantics.

Then again, perhaps it would be more clear simply to do
	#+LISPM[  anything with balanced brackets   ]