Steven Schveighoffer: > Just a blind guess, I have not tested, but maybe it's because the compiler > is using const(char) as the return type for your delegate literal since > you never specify one?
Right, this works:
import std.stdio, std.random, std.string, std.algorithm, std.range;
void main() {
string s = array(map!((i){ return cast(char)("AB"[uniform(0,2)]);
})(iota(10))).idup;
writeln(s);
}
Thank you, bye,
bearophile
