[pro] Initialization of shared slots
Svante Carl v. Erichsen
Svante.v.Erichsen at web.de
Sat Jan 8 13:50:28 UTC 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi!
Am 08.01.2011 11:22, schrieb Faré:
>>> Daniel Weinreb wrote:
>>> - however, nothing tells us that the resulting value is used immediately
>>> to initialize the slot (it could just be stored somewhere), and
>>> implementations seem to be free to do so right now, or later when the
>>> first instance is created.
>>
>> Pascal Costanza <pc at p-cos.net> wrote:
>> - When a class is defined for the first time, the :initform for a
>> shared slot needs to be evaluated immediately, and its result must
>> be stored in some temporary memory location. (There is no notion of
>> first-class dynamic environments in Common Lisp, so there is no
>> other way of ensuring that the :initform can be evaluated in the
>> correct dynamic environment.)
>
> No. You may immediately capture the lexical environment in a closure
> `(lambda () ,initform).
But that does not keep the /dynamic/ environment, as required by the
DEFCLASS specification. Am I missing something obvious?
Best wishes
Svante
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk0oa6QACgkQFZBb0npmKsyuVgCdGuuKTQbCorsLVDq+AhYA2dAs
1s8An01H8PfB6tD6zlDtYl0eGs11wzoa
=pAhh
-----END PGP SIGNATURE-----
More information about the pro
mailing list