[Issue 8803] map.filter.array run map delegate an incorrect number of time.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 16 14:20:33 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8803



--- Comment #4 from deadalnix <deadalnix at gmail.com> 2012-10-16 14:20:32 PDT ---
(In reply to comment #3)
> (In reply to comment #2)
> > Being unable to do .map.filter defeat the whole point of map and filter.
> 
> Sorry, I'm not following. Why are you saying you can't do a .map.filter? You
> can, it just calls the map function more than once per element.
> 
> What exactly is the problem?

The problem is that the delegate get executed an impredictable number of time.
Which make side effect extremely hard to handle (I ended up using
map.array.filter most of the time in my own codebase) in terms of side-effect
or performance.

Additionally, the problem is dependent of the inner implementation of both map
and filter, which should stay unknown for the user.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list