dst = src rather than src dst

Russell Lewis webmaster at villagersonline.com
Thu Sep 6 07:35:06 PDT 2007


Nathan Reed wrote:
> Kirk McDonald wrote:
>> The fact that the syntax looks nothing like assignment underscores the 
>> fact that /it is not an assignment/. I would classify the proposal as 
>> a foolish consistency, but I wouldn't really care if it were added. 
>> (Except that adding redundant syntaxes for the same operation is 
>> rarely a good idea.)
>>
> 
> I second the proposal someone already made of allowing
> 
> alias Foo as Bar;
> 
> This doesn't look like an assignment, but makes the declaration more 
> readable and allows one to easily remember which identifier is the alias 
> being created (at least, if one is a native English speaker...) at the 
> slight cost of adding the keyword 'as'.  The 'as' could be optional so 
> as not to break existing code.

I don't think that this will add a lot of clarity.  I don't know about 
other people, but when I read that syntax above, I still ask the 
question, "Is Foo being declared to be 'the same as' Bar, or is Bar 
being declared 'as a new alias of' Foo."

Perhaps it is instantly clear to other folks, I don't know.  But I know 
that at least one programmer finds the "as" syntax just as unclear as 
the original.



More information about the Digitalmars-d mailing list