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,cced0e2ac94722f3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.190.2 with SMTP id gm2mr9947039pbc.4.1326089764975; Sun, 08 Jan 2012 22:16:04 -0800 (PST) MIME-Version: 1.0 Path: lh20ni158913pbb.0!nntp.google.com!news2.google.com!goblin3!goblin.stu.neva.ru!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!feed.xsnews.nl!border-1.ams.xsnews.nl!newsfeed.x-privat.org!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada2012 : Expression functions and extended return statements Date: Mon, 9 Jan 2012 00:16:01 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <26f343ea-d694-4089-b594-f32b471db3a4@m4g2000vbc.googlegroups.com> <1bjpifgqn93x.yp3mckcm2qds$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1326089763 18064 69.95.181.76 (9 Jan 2012 06:16:03 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 9 Jan 2012 06:16:03 +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.6157 Date: 2012-01-09T00:16:01-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1bjpifgqn93x.yp3mckcm2qds$.dlg@40tude.net... > On Sat, 7 Jan 2012 15:54:44 +0100, stefan-lucks@see-the.signature wrote: > >> function Characters(I: Integer; Filler: Character := '_') return >> String is >> begin >> return Result: String(1..I) := (others => Filler) do >> return; >> end return; >> end Characters; > > OT: a return statement inside another return statement is funny. It's funny, but allowed, for the same reason that it is useful in any decent-sized chunk of code -- sometimes you need to exit in the middle. Hopefully it won't happen very often. > return X : Boolean := True do -- Illegal, I hope > return False; > end return; The "return False" is illegal, because the outer return has already specified the result. You can only use a return without an expression inside of an extended-return. Randy.