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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6327f05d4989a68d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.198.196 with SMTP id ep4mr12812193qab.3.1356641671123; Thu, 27 Dec 2012 12:54:31 -0800 (PST) Received: by 10.49.71.169 with SMTP id w9mr4805612qeu.7.1356641671088; Thu, 27 Dec 2012 12:54:31 -0800 (PST) Path: k2ni3151qap.0!nntp.google.com!ee4no2609103qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 27 Dec 2012 12:54:30 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.153.58.182; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 69.153.58.182 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0a1886ee-c97a-4deb-8794-aebdca379493@googlegroups.com> Subject: Re: compilers, was Re: Press Release - Ada 2012 Language Standard Approved by ISO From: Shark8 Injection-Date: Thu, 27 Dec 2012 20:54:31 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-12-27T12:54:30-08:00 List-Id: On Thursday, December 27, 2012 2:12:59 PM UTC-6, tmo...@acm.org wrote: > > I realize that the quality of proof needed to make this work might be > > beyond the state-of-the-art today, but I doubt that will be the case by > > the time a new version of Ada is defined. > I thought compilers were getting wider - handling more constructs - > rather than deeper - more analysis and optimization. Is that not the case? I think that that is dependent on the language you're talking about, or in MS's case [sometimes] the platform (.NET)... and that's a C-ish language. But then again, Ada's always been more for early-error detection -- static/compile-time checking is the earliest point the compiler can point out an error in our program-text. In that vein I like Randy's suggestion (though I think an OR separated list would be better than a comma separated list); I absolutely agree that there needs to be a facility for naming a 'set' of exceptions. The implementation shouldn't be too hard in the case of user-defined exceptions: the most difficult part would be recognizing that the following doesn't raise CONSTRAINT_ERROR (more correctly propagate): Type LString is Access String; -- Returns true when the strings are equal or both parameters are null. Function "=" (Left, Right: IN LString) Return Boolean is Subtype Constrained_LString is Not Null LString; Function "="( Left : LString; Right : String ) Return Boolean is begin Return Right = Left.All; exception When CONSTRAINT_ERROR => Return False; end "="; Begin Return "="(Left, Right.All); Exception When CONSTRAINT_ERROR => begin Return "="(Right,Left.All); Exception When CONSTRAINT_ERROR => Return True; end; End "="; -- Yes, it is horrid abuse of exceptions... but it'll work even in Ada 83.