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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,799e6e37c90ca633 X-Google-Attributes: gid103376,public From: Martin Dowie Subject: Re: Future Ada language revisions? Date: 1998/10/05 Message-ID: #1/1 X-Deja-AN: 397964197 X-NNTP-Posting-Host: dowie-cs.demon.co.uk:193.237.34.207 References: <6um7on$db5$1@nnrp1.dejanews.com> <6v9es0$bnv$1@nnrp1.dejanews.com> X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 907606638 nnrp-10:21090 NO-IDENT dowie-cs.demon.co.uk:193.237.34.207 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-10-05T00:00:00+00:00 List-Id: In article , Brian Rogoff writes >Since some of us don't have superfast connections, a suggestion to look on >the Deja News archives without some more info is rather unhelpful. A naive >search on obvious keywords turns up too much to scan. i've had a look through DN to see if this one has been done to death before but i can't find anything on it - if you know different please e- mail me! my suggestion concerns subprogram specs. as defined in Ada83 (i'm still reading up on Ada95, but i haven't seen anything to suggest this extension has been made) the contract made between the provider and user is clearly defined when things are going well, but when exceptions are raised, its up to the mercy of the provider to add appropriate documentation (be it user manual, code comment, whatever) to allow the user to see what to expect. Would it be feasible to extend the specification for subprograms to include a list of exceptions that can also be 'returned' from a subprogram? here's an example using of what i'm driving at (hopefully it's self explanatory) - function Blah return Boolean or exception Some_Exception; and for multiple exceptions, something like - function Blah return Boolean or exception Some_Exception, Another_Exception; the syntax i have used here also reuses existing reserved keywords, so no language extension necessary there. This would not only help the user of the subprogram but perhaps could be used by compilers/linkers to generate warnings (errors?) for unhandled exceptions or even when the body is provided if it can't/doesn't actually raise the error declared. Are there compiler problems with this, or fundamental language problems? over to the language lawyers! -- Martin Dowie