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: 103376,900edaa189af2033 X-Google-Attributes: gid103376,public From: jsa@alexandria (Jon S Anthony) Subject: Re: Ada95 OOP Questions Date: 1996/08/14 Message-ID: #1/1 X-Deja-AN: 174055171 sender: news@organon.com (news) references: <4tf3l4$4hu@masala.cc.uh.edu> organization: Organon Motives, Inc. newsgroups: comp.lang.ada Date: 1996-08-14T00:00:00+00:00 List-Id: In article ecn@explorer2.clark.net (Eric C. Newton) writes: > When I originally read about Ada 95's support for polymorphism, I > thought that it *must* support multiple dispatch arguments. That is, > if you can make any argument the "dispatcher", why not make more than > one argument the dispatcher (as in CLOS, or Cecil)? Basically, because no one knew what the "right" dispatch policy should be in such cases and no one had any intention of putting in something like the MOP. So, it didn't happen. > would choose the correct method based on the run-time types of both > obj1 *and* obj2. But if there are several to choose from at runtime??? > essential in large systems. But objects are kinda handy abstractions > as well. Relying on packages as the ONLY structuring mechanism makes > objects-as-abstractions a little more obscure because they don't > provide any structure by themselves. > > It's a pretty hard sell to say (pardon the syntax, 8-): > > struct Person; > Eat(Person); > Walk(Person); > Talk(Person); > > "That's a person. It has the features 'Eat, Walk, Talk'." > > Vs. > class Person > { > Eat(); > Walk(); > Talk(); > }; > I see no reason why _passive_ entities (the so called objects for either of the above) should look like they are acting or being commanded to act. If you want that then use an activity which in Ada would be modeled by a task: task type Person is entry Wake_Up; entry Mow_The_Lawn; ... end Person; Joe : Person; Joe.Wake_Up; -- Joe now independently goes about eating, walking, talking ... Joe.Mow_The_Lawn; -- Quit stalling and cut the grass... > package Matrixes is Shrug. And? > I keep trying to see packages like I see objects and it just doesn't > get any easier. That's because they aren't objects/classes. They are orthogonal constructs. Classes are classes (T'Class, e.g.), objects are objects ( Obj : T, e.g.) > Namespaces are good. Objects are good. Yes, Ada 95 > has both, but it is pretty good at hiding the objects. Huh? An object is quite explicit and obvious: X : T; -- X is an object for any type T. Pretty clear and obvious. > could really use the kind of tools available in Ada. I just don't > find myself wishing I could make a procedure dispatch on a type by > adding a keyword. The use of "tagged" is indeed controversial... /Jon -- Jon Anthony Organon Motives, Inc. 1 Williston Road, Suite 4 Belmont, MA 02178 617.484.3383 jsa@organon.com