D as a prototyping language (for C/C++ projects)

Jacob Carlborg doob at me.com
Thu Feb 28 07:24:31 PST 2013


On 2013-02-28 16:18, Andrei Alexandrescu wrote:

> I think it belongs to std.range.
>
> 1. tap!fun(r) returns a new range (of a new type R1 distinct from
> typeof(r)). Upon the first call to .front without an intervening
> popFront, fun(r.front) is called.
>
> 2. tap!(fun1, fun2)(r) also returns a new range, calls fun1 as described
> above, and fun2 whenever popFront() gets called without the front()
> being looked at. So fun1 tracks the looked-at data and fun2 tracks the
> ignored data.

That is not my idea of "tap". This is my idea of "tap":

Object (func) (Object o)
{
     func(o);
     return o;
}

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list