Template instantiation syntax

Walter Bright newshound1 at digitalmars.com
Fri Oct 10 16:39:00 PDT 2008


Jason House wrote:
> Is it ok to chain!nested!templates?  Gramatically, it's unambiguous.

No. The problem is, which is it?

a!b!c can be a!(b!c) or a!(b)!(c)

Andrei argued that it should be the former, as that is much more useful. 
The problem is,

a!b!c

should be equivalent to:

a!(b)!(c)

which is then equivalent to:

a!(b!(c))

which makes no sense, because what does:

a!(b,c)!(d)

mean then? It becomes a morass of special cases with no comprehensible 
rules to guide us. So, we gave up, and decided to make a!b!c illegal for 
now.



More information about the Digitalmars-d mailing list