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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6609c40f81b32989 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!i25g2000yqm.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Why is Ada considered "too specialized" for scientific use Date: Wed, 7 Apr 2010 13:21:22 -0700 (PDT) Organization: http://groups.google.com Message-ID: <98d79ce5-e45a-48c1-8979-1d0d1c12404c@i25g2000yqm.googlegroups.com> References: <602abc7e-afbe-4862-8885-b349ac4e6b90@r1g2000yqb.googlegroups.com> <0361da85-c24e-464d-a409-a370978638bc@b33g2000yqc.googlegroups.com> <7276a247-2ad8-418e-b401-34a5d61c4166@g10g2000yqh.googlegroups.com> <1x71227mbo6z9$.12n4lsrnrdcyl.dlg@40tude.net> NNTP-Posting-Host: 62.203.180.84 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1270671682 11130 127.0.0.1 (7 Apr 2010 20:21:22 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 7 Apr 2010 20:21:22 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i25g2000yqm.googlegroups.com; posting-host=62.203.180.84; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9921 Date: 2010-04-07T13:21:22-07:00 List-Id: On 7 Kwi, 15:44, "Dmitry A. Kazakov" wrote: > > As I've pointed out, that would be resolved in the same way as > > overloading by return type. > > It must be a type different from My_Other_Magic_Type then. But the reader > sees: > > =A0 =A0 Y : My_Other_Magic_Type; > > so what is the type of Y? If it effectively is not the type declared, the= n > this does not look like a good idea. This is true and this is a result of the lack of parens. If Ada adopted the convention of empty parens for parameterless functions, then Y and Y () would not be as confusing. > >>> =A0 =A0B :=3D Y (3); -- function call on Y with one param > > >> Better it be ":=3D"(B, "index" (Y, 3)); > > > Except that the notion of "index" might not be appropriate. Function > > is a more general term (indexing is a kind of function, but not the > > other way round). > > They do not intersect. Function has the syntax f(x,y,z). Index has the > syntax x(y,z). You are not consistent. Index has the syntax x(y,z), which is interchangeable with "index"(x,y,z). Function has the syntax f(x,y,z), which might be an overloaded operator with syntax x(y,z). This makes them overlapping. > > Except that with the overloaded function call operator, you would not > > need "touch", as the function body would be already a right place to > > put all such tracing. > > That depends on how you define the function "Y". "Y" is not a function, it is an object. However, it can be used in the context where a different type is expected that can be delivered by: function "call" (This : My_Other_Magic_Type) return T; where "call" is a new special operator name that I just invented. > The latter is not "touch", the former is ambiguous: > > =A0 =A0Foo (Y); -- Is it Foo(Y), Foo("Y"(Y)), Foo("Y"("Y"(Y)))? It is not ambiguous if Foo expects T and T /=3D My_Other_Magic_Type - in that case this is basic overload resolution. -- Maciej Sobczak * http://www.inspirel.com