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,54889de51045a215 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-31 14:40:12 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!82-43-33-75.cable.ubr01.croy.blueyonder.co.UK!not-for-mail From: Nick Roberts Newsgroups: comp.lang.ada Subject: Re: idem (Was: += in ada) Date: Fri, 31 Oct 2003 22:40:07 +0000 Message-ID: References: <3F7316F7.219F@mail.ru> <17cd177c.0310010606.52da88f3@posting.google.com> <3F9391B3.1080001@crs4.it> NNTP-Posting-Host: 82-43-33-75.cable.ubr01.croy.blueyonder.co.uk (82.43.33.75) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1067640011 39955635 82.43.33.75 (16 [25716]) User-Agent: Mozilla/5.0 (Windows; U; Win95; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 X-Accept-Language: en-us, en In-Reply-To: <3F9391B3.1080001@crs4.it> Xref: archiver1.google.com comp.lang.ada:1881 Date: 2003-10-31T22:40:07+00:00 List-Id: Jacob Sparre Andersen wrote: > Preben Randhol wrote: > >> The problem I have with idem is that it looks like just another >> variable. > > Yes. But it is a cool idea. And with a suitable idem marker, I think > it would make it possible to write even more readable code. Also, > "idem" doesn't look any more like another variable than the operators > "and", "or" and "not". > > What I worry most about with idem is that it would make the expression > syntax used in assignments different from that used in other places. What if we only changed the syntax of the assignment statement? Change RM95 5.2(2) to: assignment_statement ::= explicit_assignment_statement | implicit_assignment_statement explicit_assignment_statement ::= variable_name := expression; implicit_assignment_statement ::= variable_name := ALL binary_adding_operator term {binary_adding_operator term}; I've used the reserved word 'all' here, since I think it serves the purpose and saves introducing a new reserved word. This formulation adds some complexity to the definition of the assignment statement in the RM, but it avoids changing expressions in any way. Just a thought. -- Nick Roberts