Swap operator ?

Bill Baxter dnewsgroup at billbaxter.com
Thu Oct 11 16:15:30 PDT 2007


Michael Gnail wrote:
> Matti Niemenmaa wrote:
>> BLS wrote:
>>> Not really nessesary, but nice to have...
>>> int a = 1;
>>> int b = 2;
>>> a <=> b // a == 2, b == 1
>>
>> Or multiple return values, and then:
>>
>> a, b = b, a;
>>
> This is the *python* way, and I love that too.

I don't know where that syntax came from, but but I'm pretty sure it 
predates python by a good bit.  Probably Ada or something.

--bb



More information about the Digitalmars-d mailing list