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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-25 20:03:00 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: aek@vib.usr.pu.ru (Alexander Kopilovitch) Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X Date: 25 Jun 2003 20:02:59 -0700 Organization: http://groups.google.com/ Message-ID: References: <3EECA772.4B662024@adaworks.com> NNTP-Posting-Host: 62.152.82.224 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1056596579 23891 127.0.0.1 (26 Jun 2003 03:03:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 26 Jun 2003 03:03:00 GMT Xref: archiver1.google.com comp.lang.ada:39758 Date: 2003-06-26T03:03:00+00:00 List-Id: Bill Findlay wrote: >On 24/6/03 11:11, in article slrnbfg8vd.nq.lutz@taranis.iks-jena.de, "Lutz >Donnerhacke" wrote: > >> * AG wrote: >>> Seriously though, what's the (*) & X semantics? >> >> The LHS 'X' is not evaluated twice to get the parameter a of the function "&". >> For the parameter b of the same function "&", 'X' is evaluated a second time. >>> Is X allowed to be a function returning some access value? >> Yes. >>> If so, will (*) require second call to the function (with potentially >>> different result) or not? >> (*) is required to NOT evaluate the LHS expression once more. >> Furthermore this construct is required to evaluate the LHS expression before >> any part of the RHS. > >I see the semantics of idem as being well described by the following (which >would need much refinement before being precise enough for inclusion in a >standard, of course): > >Let: > > X := f(idem); > >be equivalent to declaring the procedure: > > procedure update_V_with_f (V : in out the_type_of_X) is > begin > V := f(V); > end ; > >in the environment of the assignment, and executing: > > update_V_with_f (X); > >instead of the the assignment. > >Naturally, update_V_with_f is intended to be an unspellable identifier so >that it cannot be called explicitly, etc, etc. Just one slight change in the denotation -- for convenience of common folk -:) - use "expr" unstead of "f", that is: Let: X := expr(idem); -- "expr" for an expression be equivalent to declaring the procedure: procedure update_V_with_expr (V : in out the_type_of_X) is begin V := expr(V); end ; in the environment of the assignment, and executing: update_V_with_expr (X); instead of the assignment.