gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] Re: shared-initliaze tests


From: Camm Maguire
Subject: Re: [Gcl-devel] Re: shared-initliaze tests
Date: 09 Oct 2003 11:47:09 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!

"Paul F. Dietz" <address@hidden> writes:

> Camm Maguire wrote:
> > Greetings!  The shared-initialize tests are failing due to the
> > following form:
> > (EQT OBJ (SHARED-INITIALIZE OBJ NIL :A 1 :B 3 :C 14))
> > But on both cmucl and gcl, shared-initialize does not return the
> > instance, but the initargs:
> > (setq initargs (list  :A 1 :B 3 :C 14))
> > (:A 1 :B 3 :C 14)
> > and I cannot see where in the spec it should be any different.  Can
> > you please enlighten me?
> > Take care,
> 
> 
> On the CLHS page for SHARED-INITIALIZE, the syntax is given as:
> 
>     shared-initialize instance slot-names &rest initargs &key 
> &allow-other-keys => instance
> 
> which would seem to indicate that the instance is returned.
> 
> Does it really do that on cmucl (18e or later)?
> 

Yes, it really does on my cmucl 18e, package 7 (Debian), but my
earlier message was obviously garbled.  My apologies.

Also, apparently the emacs info reader confuses nodes differing only
in capitalization.  Hence I could not find the shared-initialize spec
node as Shared-Initialize was also defined.  I've filed a Debian bug
on this.  Again my apologies.

You are right, and both GCL and cmucl are wrong.  Here is a fix, which
is going in soon (pcl_init.lisp):

@@ -134,18 +134,29 @@
 
 (defmethod shared-initialize
     ((instance slot-object) slot-names &rest initargs)
+
   (when (eq slot-names 't)
+    ;; FIXME this should be in the -t- and -nil- functions eventually
+    ;; loop through initargs looking for errors
+    (doplist (initarg val) initargs)
     (return-from shared-initialize
-      (call-initialize-function
-       (initialize-info-shared-initialize-t-function
-       (initialize-info (class-of instance) initargs))
-       instance initargs)))
+                (progn 
+                  (call-initialize-function
+                   (initialize-info-shared-initialize-t-function
+                    (initialize-info (class-of instance) initargs))
+                   instance initargs)
+                  instance)))
   (when (eq slot-names 'nil)
+    ;; FIXME this should be in the -t- and -nil- functions eventually
+    ;; loop through initargs looking for errors
+    (doplist (initarg val) initargs)
     (return-from shared-initialize
-      (call-initialize-function
-       (initialize-info-shared-initialize-nil-function
-       (initialize-info (class-of instance) initargs))
-       instance initargs)))
+                (progn
+                  (call-initialize-function
+                   (initialize-info-shared-initialize-nil-function
+                    (initialize-info (class-of instance) initargs))
+                   instance initargs)
+                  instance)))
   ;;
   ;; initialize the instance's slots in a two step process
   ;;   (1) A slot for which one of the initargs in initargs can set


As this might also be of interest to the cmucl people, could you
please forward to them?  They might have a better way, but in any case
I'm not subscribed to their list.

Take care,

>       Paul
> 
> 
> 
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]