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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,3ef3e78eacf6f938 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.eiffel,comp.lang.ada Subject: Re: Alternatives to C: ObjectPascal, Eiffel, Ada or Modula-3? Date: Fri, 24 Jul 2009 17:46:28 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <24b1e02c-ef00-4adf-be11-e65277fc095c@j32g2000yqh.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1248472000 5461 192.74.137.71 (24 Jul 2009 21:46:40 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 24 Jul 2009 21:46:40 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:CSuSMCxMZOqXKT/+R6R2C0jNm5I= Xref: g2news2.google.com comp.lang.eiffel:418 comp.lang.ada:7332 Date: 2009-07-24T17:46:28-04:00 List-Id: Colin Paul Gloster writes: > I suggest that you flip back a page and note that Page 93 untruthfully > contained: > "[..] > > In Ada[83], for example, a package may contain several routines with the same name, as > long as the signatures of these routines are different, where the signature of a routine is > defined here by the number and types of its arguments. (The general notion of signature > also includes the type of the results, if any, but Ada resolves overloading on the basis of > the argument only.) [..] > > [..]" I didn't look up the above quote from Meyer, but assuming he wrote that, he was mistaken. Ada DOES use result types to help resolve overloading. This was true in Ada 83, and it's still true the latest version (Ada 2005). Maybe he was thinking of C++ when he wrote that -- last time I looked, C++ does NOT use result types to help resolve overloading. I haven't read the latest C++ standard, but I doubt this part has changed. Anyway, I wouldn't beat up on Meyer too much over this. Ada and C++ are both large languages, and this is a minor mistake. C++ overload resolution can be done in a single bottom-up pass over the expression tree. Ada requires a bottom-up pass followed by a top-down pass, for exactly this reason (result types need to be taken into account). - Bob