Is there a better way to achieve behaviour similar to rangeFuncIf
below? f gives a contrived example of when one might want this. g
is
how one might try and achieve the same with std.range.choose.
import std.stdio;
import std.range : only, chain, join, choose;
import std.algorithm : map;
auto
On Wednesday, 22 July 2020 at 04:33:20 UTC, James Gray wrote:
Is there a better way to achieve behaviour similar to
rangeFuncIf
below? f gives a contrived example of when one might want this.
g is
how one might try and achieve the same with std.range.choose.
import std.stdio;
import std.range
On Wednesday, 22 July 2020 at 06:16:44 UTC, WebFreak001 wrote:
On Wednesday, 22 July 2020 at 04:33:20 UTC, James Gray wrote:
[...]
it seems `choose` evaluates both arguments instead of using
lazy evaluation. IMO this is a broken API to me but it has been
like this for longer so this would be
On 7/22/20 12:33 AM, James Gray wrote:
Is there a better way to achieve behaviour similar to rangeFuncIf
below? f gives a contrived example of when one might want this. g is
how one might try and achieve the same with std.range.choose.
import std.stdio;
import std.range : only, chain, join, choo