On 08/26/2015 01:27 AM, FreeSlave wrote:
> I would want to avoid redundant front evaluations.
Another option is std.functional.memoize:
import std.stdio;
import std.functional;
import std.algorithm;
import std.array;
void main()
{
auto r = [ 1, 2, 1 ]
.map!(memoize!(delegate(i
On Wed, 26 Aug 2015 08:27:05 +, FreeSlave wrote:
>
> Are there ways to fix this? Should I consider writing my own range type
> probably?
Check http://dlang.org/phobos/std_algorithm_iteration.html#.cache
On Wednesday, 26 August 2015 at 08:30:04 UTC, Yazan D wrote:
On Wed, 26 Aug 2015 08:27:05 +, FreeSlave wrote:
Are there ways to fix this? Should I consider writing my own
range type probably?
Check
http://dlang.org/phobos/std_algorithm_iteration.html#.cache
I tried it. It can help wit
Example:
import std.stdio;
import std.algorithm;
import std.path;
import std.file;
import std.exception;
import std.getopt;
import std.array;
import std.range;
auto algo(string fileName, string[] dirs, string[] extensions)
{
return dirs.filter!(delegate(dir) {
bool ok;
collec