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/21 Message-ID: #1/1 X-Deja-AN: 150737580 references: organization: /u/rogoff/.organization reply-to: rogoff@sccm.stanford.edu newsgroups: comp.lang.ada Date: 1996-04-21T00:00:00+00:00 List-Id: Robert A Duff writes: Brian Rogoff wrote: >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, I thought there was something in the Rationale about it, but I can't seem to find it by quickly flipping through (and the index isn't much help). I think the main reasons were just added complexity (complexity of the language, not so much complexity of the implementation, although that's part of it). With multi-methods, it becomes hard (for the user) to associate a particular method with a particular abstraction -- suppose I want a multi-method that dispatches on two types declared in two different packages -- where do I put it? Of course, coupled entities defined in different packages cause no end of problems ;-). I have no good answer; looking to other languages with multi-methods (CLOS, Dylan, Cecil, any others?) might suggest solutions, and things to avoid. The same is true of multilple inheritance. I remember discussing it at length with Tucker, and being overwhelmed by the number of extra rules and functionality needed to deal with name clashes and so forth. The Java approach of supporting multiple interface inheritance and only single inheritance of implementation seems to map well to Ada 95. What I find interesting about it is that it is implemented by forwarding in AdaJava, and yet I thought of it as being something you'd do with generic formal package parameters in Ada 95. I can see why it is done that way in AdaJava, I just find all of these idioms for dealing with signatures amusing. >...and is >it possible that the issue will be reevaluated in the future?". Anything's possible in Ada 0X. ;-) Also, nothing's stopping somebody from designing a language extension, adding it to GNAT or something, and playing with it to see if it makes sense. Well, I think that multi-methods would be less useful than Sather style iterators, so if I make an extension, that would be the one. -- Brian