Re: To CLOS or not to CLOS?
Len Charest <[email protected]>
| Newsgroups | gmane.comp.lang.lightweight |
|---|---|
| Message-ID | <[email protected]> |
Pascal Costanza wrote: > - It doesn't provide strong encapsulation: Methods are defined outside > classes (to make multiple dispatch work and, more specifically, to > integrate method dispatch better with functional programming). So if a > method needs access to some state that an object provides, you need to > provide that state to that method. <delurk/> I don't follow this. If a method needs access to some state that an object provides, then the object should be one of the arguments to the method. Provide the necessary state by providing an object which encapsulates the state. How is the situation here wrt CLOS any different than it is in single dispatch OO languages? Is it merely that in C++ (for example) "this" gives you the necessary state implicitly? -Len