foo!(bar) ==> foo{bar}

Lionello Lunesu lionello at lunesu.remove.com
Tue Oct 7 18:13:40 PDT 2008


"Walter Bright" <newshound1 at digitalmars.com> wrote in message 
news:gcdqa4$qas$1 at digitalmars.com...
> The foo.(bar) syntax seems to be sinking. The foo{bar} seems to be the 
> most practical alternative. So, how about putting it in the next D2 
> release on a trial basis, so people can try it out and see how it looks?

To me, using foo{bar} instead of foo!(bar) really makes no difference. In 
fact, I prefer the latter.

I think more effort should be spent on unifying template and normal code.

Partial compilation and "auto" support in the argument list might make the 
whole template syntax obsolete, since the compiler could issue a specially 
compiled version for constant argument values / argument types. Add to that 
support for "alias" template parameters in a normal argument list and we're 
on the right track:

typeof(r1) overlap(auto r1, auto r2)
 if (typeof(r1) == typeof(r2))//not really ok but it's what algorithm.d has 
now
{
//...
}

typeof(rs) filter(alias pred, auto[] rs ...)
{
//...
}

I suppose we'd also need a way to force compilation of specific 
instantiations for inclusion in precompiled libraries.

Please let me know if I'm talking BS here....

L. 




More information about the Digitalmars-d mailing list