This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GOOPS Debian packages


Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:

> It is consistent with the name-centered Lisp language to use symbols
> as the "handle" for a slot.  But it is more consistent with Scheme to
> instead skip the name and go directly on the object.  The role of slot
> names in the MOP will be taken over by a slot-definition object.  This
> will simplify code rather than complicating it.

Would we still having something akin to slot-definition-name?  Perhaps
slot-definition-name doesn't have to be a symbol, but could be any
object.  Naming slots is still useful, because it allows for
consistent reference to a particular slot-definition in a given class
without polluting the namespace.  There are very practical uses for
that, particularly when one is extending slot-definitions to do things
like shadow objects in other processes, and save to DB (including
querying objects IN the DB).  Using the CLOS MOP I built an CLOS->SQL
mapping framework which using slot-name to generate SQL for querying
objects in the database, for example

(sql:select <baz> :where [= [slot-value <baz> fooslot] 42])

Would returns me all the <baz> objects in the database, whose fooslot
were equal to 42.  In such a system, slots are explicit entities with
a name and instructions for mapping them to the database.  This does
not need to have (slot-ref and (slot-set!, but just named slots.  If
you didn't support named slots in the GOOPS default slot-definition
object, I could extend it to have a name, but it seems like a
reasonably useful property for all slots, like easier for debugging,
inspecting and all sorts of things.

I guess my point is that slots seem to naturally have a name, wether
it's in CLOS, or attributes in Java or ObjC or C++.  So it would be a
good thing to let them be accessed by name.

> (We might have something akin to slot-ref-using-class which can be
>  used instead of fetching the reader.)

We should definetly have something like that, not because it's a way
to access the slot, but because it's a hook to customize slot
reference on.

> This is still kind of experimental.  It will be possible to merge
> generics so that the result contains the methods of all merged ones.
> When I've implemented this feature, I'll ask people to have a look at
> it.  If it turns out to be a bad idea, we'll remove it.

Hmm, sounds interesting.

> > Also, (describe object) seems to be missing, and is not listed as a
> > task in the TODO.
> 
> (use-modules (oop goops describe))

I discovered that moments after sendin the email 8)

-- 
Craig Brozefsky                      <craig@red-bean.com>
Free Scheme/Lisp Software  http://www.red-bean.com/~craig
"Hiding like thieves in the night from life, illusions of 
oasis making you look twice.   -- Mos Def and Talib Kweli

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]