[Openmcl-devel] [Re: MOP Question: structure of Lambda list for direct-slot-definition-class]
Gary Byers
gb at clozure.com
Mon Feb 28 08:28:14 PST 2005
On Mon, 28 Feb 2005 rm at fabula.de wrote:
> On Tue, Feb 22, 2005 at 05:51:13PM -0700, Gary Byers wrote:
> > [... snip ...]
> > I'm not convinced that it provides the best way of handling that
> > problem, but Figure 5.2 convinces me that that's what the paragraph
> > quoted above is trying to say (e.g., that non-standard slot options
> > should not be treated consistently and resolving ambiguity - if
> > that's possible - should be left up to code that actually handles
> > the initargs.)
> >
> > So yes (kicking and screaming), this should be changed (as should
> > any code like the SHARED-INITIALIZE method above) that depends on
> > current behavior.
>
> Hello Gary,
>
> will this be changed in the upcomming release? I just recompiled bleeding-
> edge-cvs and my original code still breaks. Where actually is that part of
> the MOP implemented in the source files? I couldn't find the place where
> the slot definition initargs are "canonisized" (i.e. the wrapping into lists
> happens).
>
> Thanks RalfD
>
I checked in code that I -thought- fixed this a few days ago:
cvs log lib/macros.lisp
[...]
revision 1.25
date: 2005/02/26 00:55:37; author: gb; state: Exp; lines: +3 -1
DEFCLASS: only collect random slot option values into a list if option was
provided more than once.
[...]
The actual change (in the guts of DEFCLASS) looked like:
--- lib/macros.lisp 26 Feb 2005 00:55:37 -0000 1.25
+++ lib/macros.lisp 22 Feb 2005 22:59:42 -0000 1.24
@@ -1802,9 +1802,7 @@
,@(when type-p `(:type ',type))
,@(when documentation-p `(:documentation ,documentation))
,@(mapcan #'(lambda (opt)
- `(',(car opt) ',(if (null (cddr opt))
- (cadr opt)
- (cdr opt)))) other-options)))))
+ `(',(car opt) ',(cdr opt))) other-options))))) (let* ((direct-superclasses superclasses)
(direct-slot-specs (mapcar #'canonicalize-slot-spec slots))
(other-options (apply #'append (mapcar #'canonicalize-defclass-option class-options ))))
There was some code in the Cocoa demo infrastucture that expected to always
get a list of option values and needed to change.
I'd -assumed- that this would have fixed your test case as well, but I
haven't tried that; I'll try to do so today.
More information about the Openmcl-devel
mailing list