dst = src rather than src dst
Bill Baxter
dnewsgroup at billbaxter.com
Wed Sep 5 19:21:05 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 wouldn't say it's totally unambiguous.
When I first read it just now I thought "foo as bar ... we're going to
refer to foo as bar. Wait, that sounds just like the current alias?!"
Whereas I can't think of any way someone could misinterpret which is the
new and which is the old in "alias Foo = Bar;"
--bb
More information about the Digitalmars-d
mailing list