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,de7dd126d6737f3a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!news.netcologne.de!newsfeed-fusi2.netcologne.de!newsfeed.straub-nv.de!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Callback in Ada Date: Mon, 3 Jan 2011 15:38:29 -0600 Organization: Jacob Sparre Andersen 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> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1294090713 22545 69.95.181.76 (3 Jan 2011 21:38:33 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 3 Jan 2011 21:38:33 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 Xref: g2news1.google.com comp.lang.ada:16312 Date: 2011-01-03T15:38:29-06:00 List-Id: "Robert A Duff" wrote in message news:wcck4inqpij.fsf@shell01.TheWorld.com... > "Alex Mentis" writes: > >> 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? > > I don't remember when these features were implemented. > Apparently, the GPL 2010 has 'if' expressions, > but expression functions are more recent. That would make sense; I didn't actually write the wording for this proposal until mid-October (this was my AI). That was then approved at the late October ARG meeting. There are an outline of the feature before that, but no details; it would have been tough to implement it usefully without those details. Randy.