Talk:Inverted syntax: Difference between revisions

→‎The C example: new section
(→‎This is a nontask: it's certainly not a data processing task)
(→‎The C example: new section)
Line 68:
 
::: Ok, now the perl entry says "However this may produce different results to the traditional syntax form", but I think that that is misleading. The differing results in this case have nothing to do with the inverted conditional syntax. The differing results are because the left and right values on either side of the assignment operator are swapped. Both the traditional and inverted syntaxes would achieve the same result if they were both on the same side of the <code>=</code>. --[[User:Rdm|Rdm]] 20:00, 6 June 2011 (UTC)
 
== The C example ==
 
The C example is not right. <code>do {stuff} while (...)</code> is quite different from <code>while (...) {stuff}</code>, and if you treat them as the same, it's going to have consequences. For example, in the provided code itself, if you run the compiled program as <code>echo -n "" | ./a.out</code>, or press ctrl-D at the prompt, the <code>do{}while()</code> will access invalid memory and/or give a wrong answer. Don't tell readers <code>do{}while</code> is the same as <code>while{}</code>. --[[User:Ledrug|Ledrug]] 00:40, 4 September 2012 (UTC)
Anonymous user