dropping parentheses on template instantiation
Steven Schveighoffer
schveiguy at yahoo.com
Sun Oct 5 12:49:29 PDT 2008
"Andrei Alexandrescu" wrote
>I just realized something different. After making an informal review of
>some code, I saw that a large percentage of template instantiations only
>need ONE argument.
>
> This makes me think, with the old "!" notation, parentheses could be
> dropped entirely without prejudice:
>
> auto covariance = Matrix!real(n, n);
> auto normalized = SparseVector!double(n);
>
> and so on.
>
> To the unbridled joy of the enemies of the Sad Pirate, the dot won't work
> for template instantiation because without the parentheses it DOES
> engender ambiguity.
>
> Now say we take the following route:
>
> 1) We find something different from shouting
>
> 2) We drop the parentheses for 1 argument
>
> That sounds like a possible winner. In this case the "#" becomes
> considerably more attractive, in fact very attractive exactly because it
> looks unlike any letter:
>
> auto covariance = Matrix#real(n, n);
> auto normalized = SparseVector#double(n);
>
> Ideas?
Not loving the missing parens. Also I still like ! more than #.
I guess this is off topic, but aren't there more important problems to solve
with the D language? I appreciate that you work with templates so much, but
to change all of this based on a non-popular subjective opinion, without any
technical advantage seems like a waste of resources and time (indeed, I feel
many minutes of my life have been lost on this thread). I feel like I must
respond for my vote to be counted, but this seems like a very unimportant,
very specific bicycle shed color.
Like Jarrett, I believe there's probably not much I can do about it, since
you have your mind so tightly gripped on this shouting thing that it will
probably be changed in spite of all the resistance to it.
-Steve
More information about the Digitalmars-d
mailing list