Alternative template instantiation syntax

2012-01-26 Thread Simen Kjærås
A pattern in D is this: alias Foo!q{ stuffs } MyFoo; Where Foo is a templated struct/class. In many ways, this is similar to defining a new type, and I therefore throw out the suggestion that the syntax should reflect this. I may be wrong, but I think this syntax is unused and fitting: Foo

Re: Alternative template instantiation syntax

2012-01-27 Thread Peter Alexander
On Friday, 27 January 2012 at 01:24:54 UTC, Simen Kjærås wrote: Critique? Thoughts? What problem does this solve?

Re: Alternative template instantiation syntax

2012-01-27 Thread Timon Gehr
On 01/27/2012 02:24 AM, Simen Kjærås wrote: A pattern in D is this: alias Foo!q{ stuffs } MyFoo; Where Foo is a templated struct/class. In many ways, this is similar to defining a new type, and I therefore throw out the suggestion that the syntax should reflect this. I may be wrong, but I think

Re: Alternative template instantiation syntax

2012-01-27 Thread F i L
Timon Gehr wrote: alias MyFoo = Foo!q{ } This syntax makes a lot of sense, but why have the '=' at all? Why not just: alias Num float; alias MyFoo Foo!q{ };

Re: Alternative template instantiation syntax

2012-01-27 Thread a
On Friday, 27 January 2012 at 22:02:55 UTC, F i L wrote: Timon Gehr wrote: alias MyFoo = Foo!q{ } This syntax makes a lot of sense, but why have the '=' at all? Why not just: alias Num float; alias MyFoo Foo!q{ }; I guess one reason is that it fits better with the rest of the language,

Re: Alternative template instantiation syntax

2012-01-27 Thread F i L
On Friday, 27 January 2012 at 22:20:47 UTC, a wrote: On Friday, 27 January 2012 at 22:02:55 UTC, F i L wrote: Timon Gehr wrote: alias MyFoo = Foo!q{ } This syntax makes a lot of sense, but why have the '=' at all? Why not just: alias Num float; alias MyFoo Foo!q{ }; I guess one reason

Re: Alternative template instantiation syntax

2012-01-27 Thread Timon Gehr
On 01/27/2012 11:29 PM, F i L wrote: On Friday, 27 January 2012 at 22:20:47 UTC, a wrote: On Friday, 27 January 2012 at 22:02:55 UTC, F i L wrote: Timon Gehr wrote: alias MyFoo = Foo!q{ } This syntax makes a lot of sense, but why have the '=' at all? Why not just: alias Num float; alias My

Re: Alternative template instantiation syntax

2012-01-27 Thread F i L
No, they are all additive and backwards-compatible changes. Ahh I see now, that makes sense.