sboswell@sdcc13.ucsd.edu (....What Is?....) (06/24/91)
How do I make a CLOS method private, so it can only be called by other methods in the same class? Steve Boswell | This opinion is distributed in the hopes that it whatis@ucsd.edu | will be useful, but WITHOUT ANY WARRANTY... whatis@gnu.ai.mit.edu | -- Steve Boswell | This opinion is distributed in the hopes that it whatis@ucsd.edu | will be useful, but WITHOUT ANY WARRANTY... whatis@gnu.ai.mit.edu |
barmar@think.com (Barry Margolin) (06/24/91)
[I've redirected followups to comp.lang.clos.] In article <20905@sdcc6.ucsd.edu> sboswell@sdcc13.ucsd.edu (....What Is?....) writes: >How do I make a CLOS method private, so it can only be called by >other methods in the same class? In CLOS, methods are not "in" a class, so there's no notion of methods being "in the same class". Generic functions invoke methods when the argument types match the parameter specializers (note the plural). In general, CLOS doesn't try to implement any information hiding. SLOT-VALUE, WITH-SLOTS, and WITH-ACCESSORS can be used anywhere (even in ordinary functions rather than methods). As with the rest of Common Lisp, the onus is on the programmer to establish and follow programming conventions, rather than having them be enforced by the language. -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar