Re: But is it Object-Oriented?
Daniel Bonniot <[email protected]>
| Newsgroups | gmane.comp.lang.nice.general |
|---|---|
| Message-ID | <[email protected]> |
>All I can say is that my experience learning Nice has been very >different from what you suppose to be the case. > I'm not negating your experience. I just think that this confusion can be overcome by better documentation (in part, separating several tutorials from the user manual) and by adjustments in the semantics (the overloading/overriding issue). So your experience will have helped others to get it right more easily ;-) >We've created a fiction that the compiler reveals to be a fiction >everytime it flags an ambiguous method. There isn't a way to make sense >of compiler error messages using the fiction that Nice is like Java. > > You can only get ambiguity if you are already using multiple dispatch. So you already do at least that, although Nice is "like" Java, it has more powerful features, which lead to different kind of compiler messages. >>I don't see where we have broken the initial model. We have evolved >>it with several steps of "you can do more" and "this is actually a >>special case of that". >> >> > >We also took something away. Something quite fundamental to the >ordinary view of OO: a class encapsulates methods. > > Is that anything else than taking away a limitation? >This is quite clear: in Nice a 'private' method encapsulated in a class >is not 'private' to that class. > > Yes, the status of 'private' methods is not completely clear to me. Methods cannot be completely private, because you might need to implement them if you define a subclass and you used exact dispatch, for instance. Visibility could still limit the way you can _call_ the method. And if you define default implementations, you should avoid the need to implement that method anymore in most cases. >>Other languages have differing notions of what a class or a method >>is. For instance, C++ classes can inherit from several classes while >>Java classes cannot. The important thing is that there you can >>relate the two, and just remember this difference. I have shown >>above that you can do the same between Java methods and Nice methods. >> >> > >And AFAIK in both C++ and Java, a class encapsulates methods - this is >one of the few common threads in OO. > > We deal with a fuzzy definition of OO. C++ and Java agree on this, but not on class hierarchies. Nice and Java agree on class hierarchies, but not on other things. Dylan, CLOS, Cecil and Nice all claim to be OO without encapsulating methods. etc, etc, ... >>And in Nice the problem is even non-existent, because it is >>generalizing the concepts, not restricting them. >> >> > >I disagree. In Nice, the class no longer encapsulates methods - that is >not a generalization of OO, it's a fundamental departure. > > See above. To me it's removing a limitation. Daniel ------------------------------------------------------- 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