On Tue, 20 Mar 2012 18:36:46 +0100, ixid <nuacco...@gmail.com> wrote:

I understand the point of lazy evaluation but I often want to use the lazy algorithm library functions in an eager way. Other than looping through them all which feels rather messy is there a good way of doing this?

Is there a reason not to allow the following to be automatically treated eagerly or is there some kind of cast or conv way of doing it?

        int[] test1 = [1,2,3,4];
        int[] test2 = map!("a + a")(test1); //Eager, not allowed

        auto test3 = map!("a + a")(test1); //Lazy

std.array includes a method, array(), for doing exactly this:
int[] test2 = array(map!"a+a"(test1)); //eager

Reply via email to