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-Thread: 103376,3a1c64628a09855b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!peer1.news.newnet.co.uk!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!not-for-mail From: John McCabe Newsgroups: comp.lang.ada Subject: Re: Lack of formal syntax undermines Ada Date: Fri, 11 Apr 2008 22:25:50 +0100 Message-ID: References: NNTP-Posting-Host: assen.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.demon.co.uk 1207949163 8277 80.176.146.77 (11 Apr 2008 21:26:03 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Fri, 11 Apr 2008 21:26:03 +0000 (UTC) X-Newsreader: Forte Free Agent 2.0/32.652 Xref: g2news1.google.com comp.lang.ada:20883 Date: 2008-04-11T22:25:50+01:00 List-Id: usenet@leapheap.co.uk wrote: >Ada does not have a formal syntax. The LRM provides "syntax rules" >section by section, then collectively in Annex P. The resulting >woolly grammar is well-known to be ambiguous (e.g. is X:=Y(Z) an >assignment from a function call, array indexing or something >else?). As I understand it, that was deliberate; Ada's feature that functions may not have side-effects means that whether Y is a function or an array is irrelevant to the user as long as the result is valid. It is also related to the separation of interface from implementation. Write the implementation as an array to start with, e.g. for unit test purposes, then it can be replaced with a function without having to change the client who uses this interface.