On 20 Apr 2014, at 19:05, Joerg Arndt wrote:
* Warren D Smith <warren.wds@gmail.com> [Apr 20. 2014 19:29]:
Re swap, there should be a <--> b built into language.
An operator "<-->", _seriously_?
It's a matter of syntax. Also it should be a hardware instruction too. Jorg Arndt by saying templates can fix this, is missing my point. My point is: syntax matters. SWAP(a,b) is simply poor syntax for such a common operation. Common stuff, should be short. Principle of the Huffman code.
I can certainly live with swap(a,b). Note C is not a high level language.
?? Surely any language where the majority of instructions cover more than one machine code instruction is "high" level ;) Or to put it another way - any language that can potentially compile one instruction into *different* but equivalently performing machine code is "high" level ;)