[Prev][Next][Index][Thread]
Redefining CAR/CDR/other standard symbols (was Re: [Q] Dylan to Java/JVM compiler?)
Hello!
In article <3AFA3AF6.363109AF@no.spam.mindspring.com.no.spam>,
Lyman Taylor <lyman.taylor@no.spam.mindspring.com.no.spam> wrote:
>Lieven Marchand wrote:
>....
>> <off-topic>
>> BTW, why does LispWorks complain about the equivalent CL code? The
>> Hyperspec specifically allows users to augment the MAKE-INSTANCE
>> generic function.
> The Hyperspec allows users to define CAR and CDR.
> That doesn't mean a prudent implementation might not warn
> you or ask for confirmation before carrying that out. ;-)
Huh?
In section 11.1.2.1.2 of the Hyperspec, you find:
11.1.2.1.2 Constraints on the COMMON-LISP Package for Conforming Programs
Except where explicitly allowed, the consequences are undefined if any
of the following actions are performed on an [12]external symbol of
the COMMON-LISP package:
1. [13]Binding or altering its value (lexically or dynamically). (Some
exceptions are noted below.)
2. Defining, undefining, or [14]binding it as a [15]function. (Some
exceptions are noted below.)
3. Defining, undefining, or [16]binding it as a [17]macro or
[18]compiler macro. (Some exceptions are noted below.)
[...]
So I'd guess a (defun car ...) has undefined consequences.
>[...]
Kind regards,
Hannah.
[XP+F'up c.l.lisp]
References: