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

CLOS vs FLAVORS questions



    Date: Wed, 29 Jan 1992 17:37 PST
    From: jbarnett@charming.nrtc.northrop.com

    In the near future, I intend to start hacking a medium large system and
    am considering using CLOS on Symbolics platforms. [. . .]

    Are CLOS programmers really able to use the dispatch-on-multiple-args
    capability effectively?  Does EQL dispatching get used in nontrivial
    ways (same argument specialized sometimes by class, sometimes by a
    symbol, etc.)?

Our experience implementing CLIM in CLOS makes substantial use
of multi-arg dispatching.  For example, when we implement
several different types of widgets on several different window
system platforms (called "ports"), we use multi-arg dispatching
on both the port type and the widget type.  E.g.

(defmethod repaint-sheet ((port clx-port) (widget push-button) ...)

    On the surface of it, the repetitive use of WITH-SLOTS and/or
    WITH-ACCESSORS appears to be insidious and tedious.  There seems to be
    a lot of extra work for the common case where a method only specializes
    on one arg.  Has your experience shown this to be a groundless fear on
    my part?

Tedious, perhaps, but I'm not sure what you mean by insidious.
Some years back when I was contemplating the switch from Flavors
to CLOS I was really bothered by the idea that I was going to
have to have all these WITH-SLOTS forms just to get access to my
own instance variables!  Now, whenever I need to read some
Genera system sources (which is pretty frequently if you run the
mailer at your site :-) I am continually asking myself things
like "what is this random free reference to ORIGINAL-RECIPIENTS
doing in here?", so there is some advantage to the lexical
explicitness of WITH-SLOTS.