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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d855403bbf39dab1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.213.68 with SMTP id nq4mr7051374pbc.2.1328356986316; Sat, 04 Feb 2012 04:03:06 -0800 (PST) Path: lh20ni259375pbb.0!nntp.google.com!news1.google.com!goblin3!goblin.stu.neva.ru!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: can one create an array of a size determined by a constant value of a function? Date: Sat, 04 Feb 2012 13:03:04 +0100 Organization: Ada @ Home Message-ID: References: NNTP-Posting-Host: zaLIqR6OtyZgOpmrUj6pWA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.61 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-02-04T13:03:04+01:00 List-Id: Le Sat, 04 Feb 2012 12:00:11 +0100, Nasser M. Abbasi a = =C3=A9crit: > Quick question for the experts: > > I was looking at c++11 standard, where it show how > one can allocate an array of some size. The size is > determined by a function call. This is done at compile > time though where the compiler can determine the result > of the function, like this: > > http://en.wikipedia.org/wiki/C%2B%2B11#cite_note-2 > > "constexpr int get_five() {return 5;} Sba7 nnour Nasser :-P Just my own opinion (others may have another). With C++, =E2=80=9Cget_five()=E2=80=9D desigate a function call, while =E2= =80=9Cget_five=E2=80=9D = designate an object (well, if it's a macro, it designate who=E2=80=91kno= w=E2=80=91what). With Ada Get_Five may designate both a function call or an entity. If I understood your matter, conclusion is: Ada has this from its very = beginning. Or are you seeking for expression functions introduced since Ada 2012 ? If so, have a look here then: http://www.ada-auth.org/standards/12rm/html/RM-6-8.html -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity