[closer-devel] Initargs of slot definitions: I miss COMPUTE-E-S-D-INITARGS

Ivan Boldyrev boldyrev+nospam at cgitftp.uiggm.nsc.ru
Thu Nov 23 16:31:05 UTC 2006


I'd like to create metaclass where slot description class depends on
slot's initargs.  However, EFFECTIVE-SLOT-DEFINITION-CLASS takes only
class argument and initargs.  But initargs passed are just standard
initargs like :name, :type etc.  I cannot pass other initargs to the
E-S-D-C.

Possible solutions:

1.  (Current) Special variable is bound by
    COMPUTE-EFFECTIVE-SLOT-DEFINITION, and E-S-D-C just returns
    variable's value.  It seems to be somewhat kludgey.

2.  Use one class for all types of slots.  But this is "anti-OOP"
    solution.  As 1 is local kludge, 2 is global one (i.e. impacts
    whole program).

And one impossible solution:

3.  Change class of resulting slot definition with CHANGE-CLASS.  But
    this is explicitly prohibited by MOP.

Are there any other possible solutions?

As I cannot change initargs of effective slot, I also have to set some
slots in COMPUTE-EFFECTIVE-SLOT-DEFINITION after calling
CALL-NEXT-METHOD.

It is so pity that COMPUTE-EFFECTIVE-SLOT-DEFINITION-INITARGS is not
part of the MOP.  As I checked, C-E-S-D-I is defined in CMUCL/SBCL,
LispWorks, Allegro CL and Clisp (where it is exported symbol).  Is it
worth making CLOSER-MOP-EXT package where useful extensions like
C-E-S-D-I are collected?

P.S.  Pascal, I have read your paper, but didn't quite understand it,
mostly because of poor knowledge of subject and difficulty of reading
English.  So, no feedback yet, sorry.

-- 
Ivan Boldyrev

                                          Many are called, few volunteer.





More information about the closer-devel mailing list