[Openmcl-devel] Is this a bug?

Ron Garret ron at flownet.com
Tue Feb 7 22:45:05 UTC 2017


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: <http://lists.clozure.com/pipermail/openmcl-devel/attachments/20170207/ece932a6/attachment.html>


More information about the Openmcl-devel mailing list