Defining a static array with values in a range

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 22 02:42:59 PST 2015


Jonathan M Davis:

> auto r = chain(uiota('a', 'z'), uiota('A', 'Z'), uiota('0', 
> '9'));

Those ranges are probably open on the right.
In Bugzilla I have asked for the syntax  iota!"[]"(a, b) to 
change how the extrema are handled, modelled on 
std.random.uniform syntax.

---------------

Kagamin:

> If you declare the string as immutable, the concatenation will 
> be done at compile time.

In function-scope I think you need enum.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list