[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: do-nothing macro generates nil nevertheless
- To: info-mcl@digitool.com
- Subject: Re: do-nothing macro generates nil nevertheless
- From: barmar@nic.near.net (Barry Margolin)
- Date: 28 Feb 1995 02:08:38 -0500
- Organization: NEARnet, Cambridge, MA
- References: <gat-260295131710@milo.jpl.nasa.gov>, <3irgmq$2bk@news.internex.net>, <3002908396.988897@naggum.no>
- Sender: owner-info-mcl@digitool.com
In article <3002908396.988897@naggum.no> Erik Naggum <erik@naggum.no> writes:
>the compatibility note on page 543 also includes a note that MacLisp and
>Interlisp had splicing macro characters that could splicing of arbitrarily
>many values. I think I understand this, but maybe somebody can tell me why
>was this capability removed from Common Lisp?
Because all the uses the CL designers had ever heard of only depended on
returning 0 or 1 values -- they were all variants of #+ and #-. So they
decided to simplify the mechanism to this special case. I know this isn't
in the "kitchen sink" spirit of Common Lisp, but at the time this spirit
hadn't quite matured.
It also simplifies the reader algorithm. With the 0-or-1 value
restriction, it's very simple to specify that the reader simply starts over
if a macro character returns zero values, and returns immediately if it
returns one value. If multiple values were permitted, the reader would
have to be able to save away the extra values to be read by successive
calls to READ on that stream. I'm not sure what the right behavior should
be if the next input function on the stream isn't a call to READ.
Alternatively, this splicing could be specified as only being permitted
within a call to READ-DELIMITED-LIST, and then the reader algorithm would
have to be complicated by specifying this interaction.
--
Barry Margolin
BBN Internet Services Corp.
barmar@near.net