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-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!kanaga.switch.ch!switch.ch!news.belwue.de!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="us-ascii" Content-Transfer-Encoding: 7bit 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> Date: Wed, 7 Apr 2010 10:24:09 +0200 Message-ID: NNTP-Posting-Date: 07 Apr 2010 10:24:18 CEST NNTP-Posting-Host: b77ba86d.newsspool3.arcor-online.net X-Trace: DXC=4[WgSi@nN3]1`E>oC;JXEZMcF=Q^Z^V3X4Fo<]lROoRQ8kF On Wed, 7 Apr 2010 00:28:22 -0700 (PDT), Maciej Sobczak wrote: > On 6 Kwi, 10:07, Maciej Sobczak wrote: > >> It is only a pity that there would be no way to overload a function >> call operator for the parameterless case. ;-) > > Heck, when I think more about this it seems that even this would be > possible by analyzing the context of the given expression. That would > work in a similar way as overloading on return types. > For example, assuming that My_Magic_Type has an overloaded procedure > call operator and My_Other_Magic_Type has an overloaded function call > operator: > > declare > X : My_Magic_Type; > Y : My_Other_Magic_Type; > begin > X; -- parameterless procedure call on X A reader would expect this procedure idempotent. Consider a program: X; X; X; -- What does this do? > A := Y; -- parameterless function call on Y I would prefer the ":=" (A, Y); interpretation, here. > X (1, 2); -- procedure call on X with two params I played with the idea of adding procedural operators. E.g. X + 1; meaning a call to procedure "+" (X : in out Foo; Increment : Integer); > B := Y (3); -- function call on Y with one param Better it be ":="(B, "index" (Y, 3)); > end; > > But I'm not really sure if that would be actually useful in the > context of other Ada features. 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. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de