On 2/27/13 3:53 PM, Ary Borenszweig wrote:
Tap is nice when you want to print-debug something and you have a chain
of calls:

auto foo = x.map!(...).reduce!(...).nWayUnion!(...);

Now something is not working correctly and you want to see what's after
the "reduce!" step:

auto foo = x.map!(...).reduce!(...).tap!(r) { writefln(r);
}).nWayUnion!(...);

Otherwise you'd have to break it in many lines and then put them back
together.

I like Tap (including the name). It is similar to Unix's "tee" utility.

Andrei

Reply via email to