1.0 ?? [templates and currying]
Tom S
h3r3tic at remove.mat.uni.torun.pl
Mon Nov 6 18:26:46 PST 2006
Kirk McDonald wrote:
> This would be great! The one thing we lose is the ability to get the
> underlying function type of a delegate. If you were to also add some
> mechanism to freely convert a function type to a delegate type and vice
> versa, that would be perfect.
Or... a mechanism to derive a function or delegate type from a tuple
(for param types) and one more type (for the return type).
e.g.
static assert (is(delegateType!(int, tuple(float, out char)) == int
delegate(float, out char));
It would provide more power than just function/delegate type conversion
and simplify some parametric function generation. For instance, my Bind
lib generates a delegate from compile-type calculations based on the
curried/bound arguments and function composition.
--
Tomasz Stachowiak
More information about the Digitalmars-d
mailing list