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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2ea02452876a15e1 X-Google-Attributes: gid103376,public From: rogoff@sccm.Stanford.EDU (Brian Rogoff) Subject: Re: Multiple Dispatch in Ada 95 (Was Re: Real OO) Date: 1996/04/20 Message-ID: #1/1 X-Deja-AN: 150561624 references: organization: /u/rogoff/.organization reply-to: rogoff@sccm.stanford.edu newsgroups: comp.lang.ada Date: 1996-04-20T00:00:00+00:00 List-Id: Robert I. Eachus writes: Brian Rogoff writes: > This raises an interesting question. Why doesn't Ada 95 support > multimethods? I'm sure this was discussed somewhere, I just haven't > seen it. Does multiple dispatch break something, or was it mainly an > implementation thing? Could we see it in a future version of Ada? It is very possible to do multiple dispatch in Ada 95, and I think I even posted the idiom recently. However, you had better know what you are doing! This is not a comment on Ada 95, but on writing operations with multiple (dispatching) parameters. In Ada you define a primitive for one class with a classwide parameter of the same or another class. Sure, I've seen the approach. What I was wondering is "What criteria did the designers of Ada 95 use to decide against supporting multimethods, and is it possible that the issue will be reevaluated in the future?". I know that there are lots of implementation complexities raised by having built in multimethods, but it appears to fit in well with the Ada 95 OO model. It may be that in their study of CLOS, the designers concluded that multi-methods were just not that useful. They seem to make the handling of binary methods a bit cleaner, IMO. There is a paper by Tucker Taft on why Ada doesn't have built-in multiple inheritance. I haven't seen any similar discussion as to why Ada 95 doesn't have multiple dispatch. The obvious issue of implementation difficulty is a good enough reason, but if that were the only one, I could imagine that compiler research could render it invalid in the future. As to your point about needing to know what you are doing, I agree. We could say the same thing about operator overloading, but I sure am glad that Ada has it! -- Brian