dropping parentheses on template instantiation

Bent Rasmussen IncredibleShrinkingSphere at Gmail.com
Sun Oct 5 14:45:00 PDT 2008


I don't see how an open discussion can hurt. I guess it's only scary because 
you tend to produce heavy arguments and this is also a matter of aesthetics 
and in that war anyone can become the casualty of an opposing taste. If some 
beautiful "solution" is found then it may get express treatment, but 
otherwise I guess Walter is already working on those other priorities, not 
needing the permanent undivided attention on those priorities at all times.

- Bent


"Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> skrev i meddelelsen 
news:gcb7k2$1oer$2 at digitalmars.com...
> Steven Schveighoffer wrote:
>> "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 #.
>
> Me too especially since I discovered # creates problems with #line.
>
>> I guess this is off topic, but aren't there more important problems to 
>> solve with the D language?
>
> Well I think world hunger will have higher priority still. I have no idea 
> how people choose what to work on at any given time, but I know it's hard 
> to predict and hard to channel.
>
>> 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.
>
> Well I think it's not fair to frame this as a "me" vs. "we" issue. It 
> looks like quite a few people also have similar misgivings about the bang 
> syntax. Moreover, this thread seem to actually bring even more interesting 
> ideas to the fore. As far as popularity goes, the Sad Pirate turned out to 
> be unpopular, and a few good point against it were being made. In the 
> process of expressing that dislike, many people also revealed they didn't 
> like the Slashed-Eye Sad Guy either and looked for alternatives.
>
>> 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.
>
> Probably this needs saying - I'd never plan to leverage my being close to 
> Walter into introducing whatever change "just because I so want". Also, 
> Walter is smarter than accepting that to start with. If that's part of 
> your irritation about the whole discussion, I'm telling you you can safely 
> discount it.
>
>
> Andrei 




More information about the Digitalmars-d mailing list