More Uniform Syntax for Operating on Types aswell as Values

"Nordlöw" via Digitalmars-d digitalmars-d at puremagic.com
Thu May 8 14:21:15 PDT 2014


The more I use generic programming in D the more I long for a 
more uniform syntax for operating on types.

One improvement could be to make, for instance,

     enum isArrayOf(T, U) = isArray!T && is(ElementType!T == U);

which is used as

     isArrayOf!(T, string)

instead be expressed as, for instance,

     T.!isArrayof!(string)

or, in this binary case, even simpler

     T.!isArrayof!string

where .! is a new operator.

Have anybody discussed or even proposed such an extension?

I haven't thought about operator associativity and precedence. 
Maybe my example is plain, wrong syntatically :)

Destroy!


More information about the Digitalmars-d mailing list