Tuple mixins

Max Samukha samukha at voliacable.com.removethis
Fri May 11 01:34:14 PDT 2007


The mixin form compiles and works in some cases (in others it fails).
Is it legal at all? Is it mentioned anywhere in the specs? 

The following declares an int array and initializes it to the last
element encoded in the mixin string ([3]). Should the mixin fail with
an appropriate error or initialize the array to [1, 2, 3]?

void main()
{ 
  int[] arrr = [mixin("1, 2, 3")];
  writefln(arrr);
}


More information about the Digitalmars-d-learn mailing list