shouting versus dotting

Don nospam at nospam.com.au
Tue Oct 7 07:25:08 PDT 2008


Janderson wrote:
> 
> Personally I don't think that we should just change the symbol ! to . 
> because it will break a load of libraries for purely an ascetic change. 
>  Its difficult to argue that . is better then ! as it depends on the 
> person reading the code.  However if a template change allows for more 
> functionality then it might be worth considering.
> 
> Anyway extending a previous suggestion.  What about using ;?
> 
> Foo(int T, alias X; T val, X val2);
> 
> 
> One clash I can think of is that it might get mixup with a for loop, 
> however I imagine that's easily detectable.  Also its slightly harder to 
> make a distinction between the template args and the value however on 
> the positive side its less typing.
> 
> -Joel

This is the first suggestion which really interests me. It's really 
short, and there is some precedent for the use of ; as a separator from 
for/foreach.

But what do you do for non-function templates, which is really the 
problem case? I think you end up with a bunch of ;);), which maybe looks 
a bit odd.

auto v = new Vector!(Stack!(Tuple!(Positive!(real), Matrix!(real))))(3, 3));

becomes:
auto v = new Vector(Stack(Tuple(Positive(real), Matrix(real;););); 3, 3);




More information about the Digitalmars-d mailing list