Joseph Rushton Wakeling:
Yes, I remember you requesting that. Were there ever any PRs,
or was it just spec?
I think two different persons implemented something like "each".
A similar function is used very commonly in F#, where it's named
"iter":
http://msdn.microsoft.com/en-us/library/ee34
map won't actually compute anything until you start asking for
individual elements with front, back, or opIndex.
Personally I like to use something like
ref transform (alias action, R, T...)(ref R range, T addl_args)
{
range = action (range, addl_args);
return range;
}
to
On 06/12/14 00:58, bearophile via Digitalmars-d-learn wrote:
Joseph Rushton Wakeling:
Can anyone advise why,
map is lazy, like most other ranges.
Ah, I see. That function would only be called on consumption of the results of
the map.
Lazy higher order functions like map/filter should b
Joseph Rushton Wakeling:
Can anyone advise why,
map is lazy, like most other ranges.
and whether there's a nice range iteration option to ensure
that this function gets called using each element of the
filteredRange?
Lazy higher order functions like map/filter should be used only
with p