[Openmcl-devel] Is this a bug?

Bill St. Clair wws at clozure.com
Tue Feb 7 14:59:20 PST 2017


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.

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
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20170207/dd643c90/attachment.htm>


More information about the Openmcl-devel mailing list