Article View: net.lang.lisp
Article #577Re: Abusing "define" in Scheme... (car crashes?)
From: Barry Margolin
Date: Wed, 28 May 1986 03:39
Date: Wed, 28 May 1986 03:39
35 lines
2600 bytes
2600 bytes
In article <328@tekchips.UUCP> willc@tekchips.UUCP (Will Clinger) writes:
>I don't know how Common Lisp stands on this issue. To judge by the
>program-analyzing algorithm on page 57 of Steele's "Common Lisp: the
>Language", the names of special forms are reserved when they appear
>in the car of a form, but I don't know what happens when they appear
>in other contexts.
I think the Common Lisp definition describes the reserved status of
these symbols by saying that they cannot be given new function
definitions. The user is perfectly free to change the value cell,
package cell, and property list.
> Common Lisp distinguishes between special forms
>and macros, however, and it is clear that macro names can be shadowed
>because they live in the "function" environment, which is lexical
>except for some special treatment of the global function environment.
>On the other hand, implementations of Common Lisp are explicitly
>allowed to implement certain macros as special forms, and I don't
>know how their names can be simultaneously reserved (because they
>are special forms) and shadowable (because they are macros). I'd
>appreciate any pointers to authoritative explanations of these two
>matters.
No problem, the compiler/interpreter merely has to check whether the
user has redefined the function binding before using the built-in
definition of the macro. Only the special forms listed in the language
definition are required to be reserved. When it says that
implementations may implement macros as special forms, it is actually
saying that they are allowed to skip the explicit macro-expansion step,
i.e. interpret the macro in whatever special way they interpret special
forms.
--
Barry Margolin
ARPA: barmar@MIT-Multics
UUCP: ..!genrad!mit-eddie!barmar
Technical Details
Message-ID:
<2121@mit-eddie.MIT.EDU>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!barmarReferences:
<13508@ucla-cs.ARPA> <2048@mit-eddie.MIT.EDU> <2049@mit-eddie.MIT.EDU> <328@tekchips.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site mit-eddie.MIT.EDU Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!barmar From: barmar@mit-eddie.MIT.EDU (Barry Margolin) Newsgroups: net.lang.lisp Subject: Re: Abusing "define" in Scheme... (car crashes?) Message-ID: <2121@mit-eddie.MIT.EDU> Date: Tue, 27-May-86 23:39:21 EDT Article-I.D.: mit-eddi.2121 Posted: Tue May 27 23:39:21 1986 Date-Received: Thu, 29-May-86 04:03:48 EDT References: <13508@ucla-cs.ARPA> <2048@mit-eddie.MIT.EDU> <2049@mit-eddie.MIT.EDU> <328@tekchips.UUCP> Reply-To: barmar@mit-eddie.UUCP (Barry Margolin) Distribution: net Organization: MIT, EE/CS Computer Facilities, Cambridge, MA Lines: 35 Keywords: Scheme