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

Re: accessor functions



    Date: Fri, 18 Jul 86 17:37 EDT
    From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>

        Is the accessor function created for a :readable-instance-variable defined
        to be an ordinary function or a generic function?
    
    Generic.  What would ever make you think otherwise?

Well, I did think that they most likely were generic, but I wanted to be sure
(I did not find an answer in the documentation I have).

However, there are a couple of things that might lead one to think otherwise:

  1. The most recent documentation I have indicates that the names of
     accessor functions in both New Flavors and CommonLoops include
     the name of the class as a prefix (at least by default).  If the
     accessor functions are generic, this extra "protection" against
     name conflicts would seem unnecessary and perhaps undesirable.
     What's the rationale for this default?

  2. It is useful to be able to inline-expand invocations of the accessor
     functions.  (Inline substitution is normal for structures, isn't it?)
     Since generic functions work on subclasses, inline substitution of
     accessor functions in generic functions is not possible unless one
     prohibits redefinition of the accessor functions by subclasses (or the
     invocations are defined to be immune from such redefinition -- which can
     be achieved in CommonObjects by using CALL-METHOD).  Making the accessor
     functions ordinary functions is one way to prohibit redefinition by a
     subclass.
-------