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,8f8cea8602e61aba X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: The Red Language Date: 1997/09/18 Message-ID: #1/1 X-Deja-AN: 273619838 References: <340E2DC5.25D7@worldnet.att.net> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-09-18T00:00:00+00:00 List-Id: In article , Robert Dewar wrote: >Matthew said No, I said it. (That's the third time this week, Robert. ;-)) ><<> Perhaps because it's harder to implement. In C++, you can do overload >> resolution in a single bottom up pass. Start at the leaves of the >> expression, and propagate the type of each expression up. In Ada, you >> need to propagate *sets* of types (or sets of interpretations, or some >> such) up the tree, and then you have to do a second (top down) pass to >> propagate the information back to the leaves.>> > > >I think only a non-implementor would say this. Not true. I'm an implementor, and I said it. ;-) >... The two passes are not >a significant complexity issue. The difficulties in overloading resolution >in Ada (or C++ for that matter) have to do with special situations and >special rules that must be taken into acccount. The basic 2-pass resolution >algorityhm is trivial. It's true that all kinds of special situations are a pain, but I still claim that the 2-pass algorithm required by Ada is more complicated than the 1-pass algorithm of C++ and Red. The 2-pass algorithm requires *sets* of types to be passed up the tree, whereas in the 1-pass algorithm you can pass a single type up the tree. Yeah, I agree that's not such a big deal, and I certainly think the Ada way is Good. So, Robert, why do *you* think the C++ and Red designers decided that function results should not affect overload resolution? My claim was that it's because it's harder to implement. Maybe that implementation concern is not such a big deal, but I can't think of any *other* reason, so what do *you* think? Perhaps "It's not (much) harder to implement, but they *thought* it was at the time"? - Bob