handful and interval

Jacob Carlborg doob at me.com
Sun Sep 2 23:28:16 PDT 2012


On 2012-09-02 17:29, Dmitry Olshansky wrote:

> I wouldn't question utility but rather the implementation of the above.
> One thing I'd love to see is thing like
> handful!("struct", "class", "union")
>
> that does pre-process contents at compile time to speed up search.
> In other words it's possible to not only come close to  a series of a ==
> "struct" || a == "class" || a == "union" but surpass it.

Sounds like an enhanced tuple?

> At the very least handful!(a,b,c) can take expression tuple and make
> x in handful!(a,b,c) lower to:
> return x == a || x == b || x == c;
>
> even for run-time variables a, b & c.
>


-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list