Random Suggestion: Swap Operator <=>?

Michiel Helvensteijn m.helvensteijn.remove at gmail.com
Sun Jul 19 08:07:04 PDT 2009


Simen Kjaeraas wrote:

>> I have a swap operator in my new programming language:
>>
>> x <-> y;
>>
>> It's syntactically consistent with the assignment operator:
>>
>> x <- E;
> 
> Clearly, this should be generalized to allow both right-to-left and
> left-to-right assignment. :p

I thought about that. Of course it has a certain symmetry. But having two
different syntaxes for standard assignment isn't right.

And right-to-left has its advantages. You can see at a glance which variable
is going to change value.

-- 
Michiel Helvensteijn




More information about the Digitalmars-d mailing list