Re: But is it Object-Oriented?
| Newsgroups | gmane.comp.lang.nice.general |
|---|---|
| Message-ID | <[email protected]> |
Quoting Daniel Bonniot <[email protected]>: > > >'many practicing programmers used to single-dispatching object-oriented > >languages complain that multi-methods just don't feel object-oriented.' > >... > >the extant generic-function-based approach to multiple-dispatching > >object oriented languages tends to encourage a function-oriented > >programming style at the expense of a data-abstraction-oriented > >programming style. > > > There is not less data abstraction when you have multi-method than when > you are restricted to mono-methods. In both cases, outside of the > package defining a class, you can only use the operations that are > public. The paper that Isaac cited argued exactly against this. The argument cited was like this: Some "fundamental" methods need access to the implementation (fields) of a "class" and some methods can be implemented purely in terms of those fundamental methods. But, how do you distinguish which methods are fundemental (privileges to access private members) and which aren't? Let's say that if a method implementation has a parameter specialized on a particular "class" then it is given privileged access. Otherwise, it isn't. Then, we can recognize all the fundemental operations of each "class" by looking at the method argument specializations. I think everybody here agrees that this isn't a good idea. Like I mentioned before, I think that ADT = module = types+functions like in OCaml/SML. - Brian ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click