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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC 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!news4.google.com!feeder2.cambriumusenet.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!195.96.0.7.MISMATCH!newsfeed.utanet.at!newsfeed01.chello.at!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Why is Ada considered "too specialized" for scientific use Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH 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> Date: Wed, 7 Apr 2010 15:44:39 +0200 Message-ID: <1x71227mbo6z9$.12n4lsrnrdcyl.dlg@40tude.net> NNTP-Posting-Date: 07 Apr 2010 15:44:44 CEST NNTP-Posting-Host: 47976db5.newsspool4.arcor-online.net X-Trace: DXC==eWoab2^c5685[]]\]T0814IUKb_MXahC5e9?ILilSQ9^`E3HO39[o@g8j7 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:9913 Date: 2010-04-07T15:44:44+02:00 List-Id: On Wed, 7 Apr 2010 04:59:59 -0700 (PDT), Maciej Sobczak wrote: > On 7 Kwi, 10:24, "Dmitry A. Kazakov" > wrote: > >> A reader would expect this procedure idempotent. Consider a program: >> >> � �X; X; X; -- What does this do? > > This is the same as today with regular parameterless procedures: > > procedure X (Spacing : in Positive_Count := 1) > renames Ada.Text_IO.New_Line; > > Now, what the reader would expect from your example? The reader knows that New_Line is a shortcut for New_Line (Standard_Input); It is a bad style to hide the effects of a procedure. New_Line is rare exception form this rule. >>> � �A := Y; � � -- parameterless function call on Y >> >> I would prefer the ":=" (A, Y); interpretation, here. > > 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: Y : My_Other_Magic_Type; so what is the type of Y? If it effectively is not the type declared, then this does not look like a good idea. >>> � �B := Y (3); -- function call on Y with one param >> >> Better it be ":="(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). >> The things you could do with your proposal could probably be achieved in >> other ways. For example, I considered a "touch" primitive operation, which >> similarly to Adjust, to be called each time you access a volatile object in >> order to get its value. This could be useful for tracing, interlocking, >> garbage collection, persistency layer purposes, etc. > > 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". Is it function "Y" (This : My_Other_Magic_Type) return My_Other_Magic_Type; or function "Y" return My_Other_Magic_Type; The latter is not "touch", the former is ambiguous: Foo (Y); -- Is it Foo(Y), Foo("Y"(Y)), Foo("Y"("Y"(Y)))? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de