Using import in map

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 31 11:54:22 PST 2015


On Saturday, 31 January 2015 at 19:52:11 UTC, Jacob Carlborg 
wrote:
> Is this supposed to work:
>
> enum foo = ["foo"].map!((string e) => import(e));
>
> When I compile the above code with 2.066.1 I get the following 
> error:
>
> main.d(1): Error: variable e cannot be read at compile time
> main.d(1): Error: file name argument must be a string, not 
> (__error)

I think this is not supposed to work.
try staticMap maybe ?



More information about the Digitalmars-d mailing list