My read of the spec is that either
behaviour is allowable.
DEFSTRUCT[1] says:
"If a slot is not initialized in this way, it is initialized
by evaluating
slot-initform in the slot description at the
time the constructor function is called."
Which makes no reference to the environment in which the form
should be evaluated in.
Later on it says:
"It is as if the
slot-initforms were used as
initialization
forms for the
keyword
parameters of the constructor function"
The page describing keyword arguments in ordinary lambda lists[2]
also makes no reference to which environment should be used for
initforms.
I guess they didn't think about people using closures for
initforms when they were drawing it up?
To side-step the issue I would invoke a closure from the initform
instead (if that's how you want to do it).
[1]
http://www.lispworks.com/documentation/HyperSpec/Body/m_defstr.htm
[2]
http://www.lispworks.com/documentation/HyperSpec/Body/03_dad.htm
On 03/08/15 23:04, Peter Stirling wrote: