Using lazily ?
Timon Gehr
timon.gehr at gmx.ch
Fri Mar 2 03:26:55 PST 2012
On 03/02/2012 12:12 AM, bearophile wrote:
> Ali:
>
>> Note that Timon's inner foreach is a compile-time foreach, which is the
>> equivalent of the following three lines:
>
> I'd like it to be written:
> static foreach (...) {...
>
> In the meantime an annotation helps clarify the code for the person that will read the code:
> /*static*/ foreach (...) {...
>
> Bye,
> bearophile
static foreach should also be available for declarations. I have a lot
of code of the following form:
mixin({
string r;
foreach(x; [".","..","..."]) r~=X!q{...};
return r;
}());
More information about the Digitalmars-d-learn
mailing list