[Openmcl-devel] Is this a bug?
james anderson
james at dydra.com
Wed Feb 8 09:36:34 PST 2017
good evening;
> On 2017-02-07, at 23:59, Bill St. Clair <wws at clozure.com> wrote:
>
> Not that I know of. I think it would work to set all the slots unbound and call initialize-instance. I’ve never grokked reinitialize-instance, even though I implemented it way back in 1990.
it is a context which would give one license to implement the unbind-everything-and-call-shared-initialize protocol.
>
> On Tue, Feb 7, 2017 at 5:45 PM, Ron Garret <ron at flownet.com> wrote:
> Ah.
>
> Is there a standard method that unconditionally calls all of the initform methods on an instance? Or that simply restores the instance to its newly created state? I tried INITIALIZE-INSTANCE and REINITIALIZE-INSTANCE and neither one of those seemed to work.
>
> On Feb 7, 2017, at 2:26 PM, Bill St. Clair <wws at clozure.com> wrote:
>
>> shared-initialize only initializes UNBOUND slots:
>>
>> CL-USER> (slot-makunbound foo 'x)
>> #<FOO #x302000B8CA5D>
>> CL-USER> (ignore-errors (foo-x foo))
>> NIL
>> #<UNBOUND-SLOT #x302000BF27FD>
>> CL-USER> (shared-initialize foo t)
>> #<FOO #x302000B8CA5D>
>> CL-USER> (foo-x foo)
>> 123
>>
>>
>> On Tue, Feb 7, 2017 at 5:17 PM, Ron Garret <ron at flownet.com> wrote:
>> ? (DEFCLASS FOO () ((X :accessor foo-x :INITFORM 123)))
>> #<STANDARD-CLASS FOO>
>> ? (setf foo (make-instance 'foo))
>> #<FOO #x302001F7ABFD>
>> ? (foo-x foo)
>> 123
>> ? (setf (foo-x foo) nil)
>> NIL
>> ? (foo-x foo)
>> NIL
>> ? (shared-initialize foo t) ; I would have expected this to set X back to 123
>> #<FOO #x302001F2BAAD>
>> ? (foo-x foo)
>> NIL
>>
>> _______________________________________________
>> Openmcl-devel mailing list
>> Openmcl-devel at clozure.com
>> https://lists.clozure.com/mailman/listinfo/openmcl-devel
>>
>
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel
More information about the Openmcl-devel
mailing list