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: a07f3367d7,de7dd126d6737f3a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Alex Mentis" Newsgroups: comp.lang.ada Subject: Re: Callback in Ada Date: Sun, 2 Jan 2011 15:38:27 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <8lc2d0Fb6jU1@mid.individual.net> <4cf0ec67$0$6882$9b4e6d93@newsspool2.arcor-online.net> <393221c0-ac56-436f-b3f8-280c40d5a53a@j1g2000vbl.googlegroups.com> <10p6vzd761rdz$.1gtmc0fk6t9rb.dlg@40tude.net> <704b1c18-9d58-420f-b7af-205ccd1ca7ad@g26g2000vbz.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 2 Jan 2011 15:38:27 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="LuNBe46aq3RH8fhR+DTFSg"; logging-data="16865"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+bJ2+ygTFZsxb7vnNWOyPTFlOv0JU/1P0=" User-Agent: XanaNews/1.19.1.269 Cancel-Lock: sha1:kQQasUhC7XauxpKUeXgZArc81bc= Xref: g2news2.google.com comp.lang.ada:17278 Date: 2011-01-02T15:38:27+00:00 List-Id: Robert A Duff wrote: > function Foobar (A : Integer) return Integer is (if A > 10 then A - 5 > else A); ... > Actually, the latest version of GNAT supports the above, > and a bunch of other Ada 2012 features. > > - Bob I was not able to get a short test program using the code above to compile using GNAT GPL 2010 from AdaCore, even when using the Ada 2012 switches (-gnat12 and -gnat2012) and pragma (pragma Ada_2012). The error I get makes it appear that the parser is looking for a �begin� for function Foobar. Using the following worked, though: function Foobar (A : Integer) return Integer is begin return (if A > 10 then A - 5 else A); end Foobar; What am I missing? -Alex