[Top][All Lists]

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

Re: [GOOPS] make class-name a generic?

From: Mikael Djurfeldt
Subject: Re: [GOOPS] make class-name a generic?
Date: Tue, 24 Feb 2004 09:59:09 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Andreas Rottmann <address@hidden> writes:

>> Could you explain why you need to add methods to class-name?
> Because it's very convinient in my case: I'm working on G-Wrap-TNG (an
> OO-rewrite using GOOPS of G-Wrap[0]) and in the G-Wrap environment, I
> have "types", which can be attributed with a class name. Note that a
> type is an instance in G-Wrap; so it would be very nice to be able to
> say (class-name type) to get the class name associated with a type.

Well, the "class-" part of "class-name" is supposed to mean that it's
a selector for class objects.  If type is not a class object, then I
would say it's not a good idea to use class-name on it.  Why don't you
use the name "type-name"?

The reason I'm putting up some resistance here is that I would only
want to make the change if there is a real need, because this
particular set of selectors (class-name, class-slots etc) are so
fundamental that making them into generic functions would easily
complicate the reflexive structure of GOOPS.  (They are a kind of
"base cases" in the MOP if you know what I mean.)  I also have the
feeling that they are so specific in their function that it's
questionable if one really would like to hang new methods on them.

BTW, have you considered making your type objects real class objects?
I'm asking without having looked at your code, but I remember that
when I worked on a rudimentary C API for GOOPS, I had the idea to have
classes representing "foreign" objects, i.e. objects not allocated or
administered by GOOPS.  That way one could perhaps more easily use
some of the facilities in GOOPS such as slot access and accessors.


reply via email to

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