comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
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
Date: 2012-02-04T13:03:04+01:00	[thread overview]
Message-ID: <op.v85k3eneule2fv@douda-yannick> (raw)
In-Reply-To: jgj33s$290$1@speranza.aioe.org

Le Sat, 04 Feb 2012 12:00:11 +0100, Nasser M. Abbasi <nma@12000.org> a  
écrit:

> 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++, “get_five()” desigate a function call, while “get_five”  
designate an object (well, if it's a macro, it designate who‑know‑what).

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

-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University



  reply	other threads:[~2012-02-04 12:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-04 11:00 can one create an array of a size determined by a constant value of a function? Nasser M. Abbasi
2012-02-04 12:03 ` Yannick Duchêne (Hibou57) [this message]
2012-02-04 18:36 ` Robert A Duff
2012-02-04 18:47 ` Jeffrey Carter
2012-02-05 11:12 ` Pascal Obry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox