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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,e646052dc594401f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!w12g2000yqj.googlegroups.com!not-for-mail From: Alexandre K Newsgroups: comp.lang.ada Subject: Re: Strategies with SPARK which does not support exceptions Date: Fri, 18 Jun 2010 14:51:11 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9e783a9c-f201-4cd9-901e-e1f1da882038@w12g2000yqj.googlegroups.com> References: <28cc6b90-fce4-44e0-903e-9c1dd1b91f5a@c33g2000yqm.googlegroups.com> <610aab02-26cd-4d66-9b45-ebdee71c8aad@c10g2000yqi.googlegroups.com> NNTP-Posting-Host: 83.158.232.93 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1276897871 15891 127.0.0.1 (18 Jun 2010 21:51:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 18 Jun 2010 21:51:11 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w12g2000yqj.googlegroups.com; posting-host=83.158.232.93; posting-account=TcezFQoAAAAjIIx-1YP3Hv74ICh_b8qk User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.80 (Macintosh; Intel Mac OS X; U; fr) Presto/2.2.15 Version/10.10,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:12788 Date: 2010-06-18T14:51:11-07:00 List-Id: > Well, I do not know if 'goto's are allowed in SPARK, but that is the > solution that sometimes I use when I need to write code in the- > language-whose-name-is-a-single-letter :-). =A0I know that it could > sound heretical, but this is one of the two cases where, I believe, > using goto is not so bad. =A0I am thinking something like Hi everyone, Well, Goto are, as exceptions, not allowed in Spark. To answer to Yannick, the way to replace exception is to use Boolean, or Enumerates in an "out" parameter. It is the case when you need to use an Ada program that uses exceptions, and you have to write a package specification with Spark and hide the implementation in the body. (--# hide). The Spark_IO package is an example of hiding the use of Ada.Text_IO, and of course File exception. Also, I think we should not use exception to control the flow of the program. Alex.