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

Re: accessor functions

I and most (but not all!) of my users agree with this philosophy
and use it also.

    Date: 23 Jul 86 13:27 PDT
    From: Gregor Kiczales <Gregor.pa@Xerox.COM>

    It is true that the default value for the "conc-name" is the name of the
    class.  But in practice I tend to use the same conc-name for all the
    classes in a class-tree.  As an example, in PCL the conc-name for
    essential-class and all the classes which include it is "class-".  This
    means that the accessor for the slots of any kind of class is
    "CLASS-SLOTS".  When I see "(class-slots x)" in code, I read it as "x is
    some kind of class, there will be a method on class-slots which knows
    how to get x's slots.

    While generic functions let you use a conc-name of nil I personally
    don't like this style.  As an example, using conc-name nil would allow
    the accessor for all things which have a name to be just "NAME".  I
    prefer to see "(CLASS-NAME x)" because it tells me that x is some kind
    of class.

    Perhaps a more liberal use of packages or just the passage of time will
    change my philosophy about this, I don't know.