equivariant functions

Steven Schveighoffer schveiguy at yahoo.com
Tue Oct 14 11:40:59 PDT 2008


"Denis Koroskin" wrote
> On Tue, 14 Oct 2008 22:16:33 +0400, KennyTM~ <kennytm at gmail.com> wrote:
>
>> "same" seems to be a common identifier though..
>>
>> "inout" already has an equivalent keyword. It is called "ref".
>
> Yeah, I know :)
> Thanks anyway.
>
> But is there any reason to worry about name collision? I just grep'd about 
> 20Mb of C++ source code and didn't find *a single* usage of `same' outside 
> of the comments.

I'd say if we were to add a keyword, same would be on the list of choices, I 
can't think of a common usage for it.

But you can't deny that in general using a commonly used symbol as a keyword 
might be a bad idea.

For example 'get' or 'next'.

So yes, when adding a keyword, one should be wary of how it affects commonly 
used keywords, and yes, 'same' is a good choice in that regard ;)

For example, when porting Tango to D2, I had to change about 5 or so 
singleton members (and their uses) named 'shared' since it is now a keyword.

-Steve 





More information about the Digitalmars-d mailing list