Caching in computing ranges (and contributing to Phobos)

Tomek Sowiński just at ask.me
Sat Oct 9 14:06:23 PDT 2010


Peter Alexander napisał:

> On 9/10/10 8:58 PM, Pelle wrote:
>> How about never having caches and if you need them, you can get a
>> cached(map(..etc..))?
>>
>> I do not understand where the notion that ranges should have caches come
>> from. It destroys the possibility for using const and complicates the
>> writing of them.
> 
> I agree with this. Caching should not be a default.
> 
> As it stands, I know that std.algorithm.Map uses a cache, I haven't
> checked any others.

std.range.Sequence also caches. I swear I saw Zip do it too, but looking at the code now, I 
see no cache.

By the way, I've been reading Phobos quite intensively lately and I'm willing to spend some 
time to make the change Pelle was talking about (remove caching, add the Cached higher-
order range).

How can I contribute that to Phobos?

-- 
Tomek


More information about the Digitalmars-d mailing list