Working functionally with third party libraries
via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Jul 18 02:33:35 PDT 2015
On Saturday, 18 July 2015 at 09:18:14 UTC, Kagamin wrote:
> On Saturday, 18 July 2015 at 08:03:56 UTC, Jarl André Hübenthal
> wrote:
>> Its simple. In most cases you do an advanced aggregated search
>> in mongo, and what you get is then a mongocursor. Lets say I
>> am retrieving all projects for a given customer where the
>> project is started.. I really am in no interest of lazily
>> evaluating this result, because I want to return this data to
>> the client (browser) immediately.
>
> How big is the slowdown you notice for lazy processing? Lazy
> processing is believed to be faster because it's less resource
> consuming.
>
>> And lets say I am in a prototype phase where i haven't yet
>> implemented all those nasty mongo queries, I want to be able
>> to filter, map and reduce the result and work with arrays not
>> some sort of non evaluated lazy MapResult.
>
> I believe those algorithms were written to work on lazy ranges.
> What makes you think they can't do that?
I don't understand where you are going with this. I have solved
my problem. Laziness is good for lets say take 5 out of infinite
results. When you ask for a complete list and want the complete
list, you take all. In clojure you actually say that, "doall". In
D .array does the same thing. Converts lazy to non lazy.
More information about the Digitalmars-d-learn
mailing list