Improving (foreach) ranges
Robert Clipsham
robert at octarineparrot.com
Thu Jun 9 16:33:22 PDT 2011
With the introduction of std.parallelism, I've been wondering about the
following:
foreach (i; 0..100)
{
}
For most uses of foreach, you can just wrap the range in parallel(), but
with a foreach range statement you can't do this. Of course iota() could
be used:
foreach (i; parallel(iota(0, 100)))
{
}
But that seems inconsistent. What are people's thoughts on making the
syntax a..b more general, so you can do eg:
void foo(int[]);
foo(0..100);
Although, I seem to recall seeing this conversation elsewhere, let me
know if this is the case.
--
Robert
http://octarineparrot.com/
More information about the Digitalmars-d
mailing list