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

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Oct 7 21:04:18 PDT 2008


Sandeep K wrote:
> I don't like {} at all. {} should be for function bodies, lamdbas.

     struct S { int a, b; }
     S s = { 1, 2 };

> Here's a thought: By default make all templates belong to a reserved
> namespace. So prefix the namespace when you need to disambiguate.
> Call the namespace "T" or "template" or ? T.foo(T.meow()) All
> templates in the current namespace say Cat get collected under Cat.T
> 
> 
> Might look bad but I don't think any of the other solutions look that
> great either. This syntax looks a lot more uniform to functions.

I hope we can find something terser.


Andrei



More information about the Digitalmars-d mailing list