From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1108a1,c52c30d32b866eae X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,2ea02452876a15e1 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Real OO Date: 1996/05/10 Message-ID: #1/1 X-Deja-AN: 154180803 references: <4mls4h$sau@watnews1.watson.ibm.com> <4mqbls$vtc@watnews1.watson.ibm.com> <4n066d$6gl@gaia.ns.utk.edu> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada,comp.object Date: 1996-05-10T00:00:00+00:00 List-Id: In article <4n066d$6gl@gaia.ns.utk.edu>, Matt Kennel wrote: >I know this is flame bait, Flame bait? Nah, just a reasonable technical opinion. I hope this doesn't look like a "flame"? >... but in my opinion, if you're going to have >a single 'dispatching'/'controlling'/'tagged' operand you might as well >bite the bullet and specifically designated it like Eiffel does. > > Op(a,b,tagged c) <-> c.Op(a,b) OK, but Ada allows more than one of them to control the dispatching. It's not multimethods -- they all have to have the same tag. But, to me, Union(This_Set, That_Set) ought to make it look like This_Set and That_Set have equal rights -- i.e. it ought to look symmetric. This_Set.Union(That_Set) seems inelegant to me. I wouldn't mind a syntax that made This_Set and That_Set look "special" in some way, but I object to the idea that I have to choose only one of them as the special one. Also, what do you make of Ada's dispatching-on-result? E.g., Union(This_Set, Empty_Set), where Empty_Set is a function, and this dispatches to the "right" Empty_Set based on the tag of This_Set? Maybe that's a silly example, since we know what union with the empty set means. Maybe Union(This_Set, Singleton(37)) is a better example, where Singleton takes an Integer (not dispatching on that Integer), and returns a set. Or maybe, Intersection(Union(Singleton(37), Singleton(24)), This_Set) where the tag of This_Set controls which Singleton operation to dispatch to. What about operations that belong with the type, but don't depend on any particular object of the type? In Smalltalk, it would be a class method. Ada's packages are like Smalltalk's class objects (although rather less dynamic). >Writing things as Op(a,b,c,d,...) does seem to imply multimethods to >most people. (It did to me.) Perhaps. I don't think the Ada Reference Manual gives that impression. >After peeling away the surface Ada has more similar semantics to >Eiffel than admitted---yes there really is >such a thing as a 'class(Eiffel-usage) interface' of a certain >type, even though "theoretically" interfaces are just properties of >packages which don't have anything to do with types. Admitted? Yes, Ada and Eiffel are quite similar, in many ways. I will certainly admit that. There's a notational difference, in that the dispatching operands aren't syntactically distinguished in Ada. There are (fairly minor) functionality differences. And Ada doesn't need "system validity checks". One fairly important difference is the distinction that Ada makes clear between a particular class/type in the hierarchy, vs. all class/types descended from there -- other languages, including Eiffel and C++ obscure that distinction. There are other differences, too, but I agree that there's a lot of similarity (both are strongly typed (at compile time) OOP languages). - Bob