[Openmcl-devel] DEFSTRUCT and :INCLUDE
tfb at tfeb.org
Wed Oct 14 08:55:53 UTC 2009
On 13 Oct 2009, at 16:43, Daniel Weinreb wrote:
> There are two separate questions here: what is the
> definition of the Common Lisp language, and what
> should CCL do?
> Regarding the former, I think I can say pretty reliably
> that during the design of CL, nobody thought about
> this. So the spec is not written in such a way as to
> give unambiguous guidance about what these forms
> ought to do.
I agree with this. However I think it's clear that, if they had
thought about it, they would not have mandated the kind of obscure
accidental name-capture that CCL does (and which other implementations
may well do as well), if only because it would give the hygienic macro
people cause to poke fun at CL.
I think one could argue from this text: "The slot default init forms
are evaluated in the lexical environment in which the defstruct form
itself appears and in the dynamic environment in which the call to the
constructor function appears." that CCL (and some other
implementations) are wrong. However this is not clear enough since
"the defstruct form" needs to be something like "the defstruct form
which introduces the init form".
> In a case like that, the CCL maintainers have to
> give some consideration to the question of
> whether introducing a new behavior that is
> not consonant with other CL implementations
> may be a drawback of a proposed change (to
> be weighed among all the pros and cons).
I also agree with this. However I suspect strongly that the number of
instances of code which defines structures which include other
structures, which have init forms which capture names like this, *and*
where the included structure was defined in a non-empty lexical
environment is zero. So the change would not affect any code.
On the other hand the same argument says that this is fixing a problem
which never affects any code, so why do it?
I guess my original message was just so it would appear in an archive
somewhere, I was not expecting a fix. What I probably should have
done is file a very low priority bug or something, but I don't know
how (no, don't tell me!).
More information about the Openmcl-devel