in reply to Re^7: Pre vs Post Incrementing variables
in thread Pre vs Post Incrementing variables
the operands of the comma operator should be the results of the preincrement subexpressions.
Correct. And it does. For good or bad, the result of preincrement is the variable that was incremented. We've covered that you wish it wasn't. I don't disagree.
Not two references to $n after both sub-expressions have been evaluated.
Correct. It doesn't. It returns $n after the first preincrement has been evaluated and $n after the second preincrement has been evaluated. Like I said earlier, the evaluation order is already what you would expect it to be.
use 5.010; # say use Data::Alias; sub f { say @_; } $n=3; f(++$n, 0+$n, ++$n); $n=3; do { local @_; alias $_[0] = ++$n; alias $_[1] = 0+$n; alias $_[2] = ++$n; &f; };
545 545
As for your ploy of resorting to meta-argument to distract from the argument
"You think that you know better what the authors of that passage meant when they wrote it, than they did." is not an argument.
Update: Improved example.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Pre vs Post Incrementing variables
by BrowserUk (Patriarch) on Sep 13, 2010 at 08:51 UTC | |
by ikegami (Patriarch) on Sep 13, 2010 at 14:42 UTC | |
by BrowserUk (Patriarch) on Sep 13, 2010 at 15:10 UTC | |
by ikegami (Patriarch) on Sep 13, 2010 at 15:29 UTC | |
by BrowserUk (Patriarch) on Sep 13, 2010 at 16:00 UTC | |
| |
by JavaFan (Canon) on Sep 13, 2010 at 09:02 UTC | |
by ikegami (Patriarch) on Sep 13, 2010 at 15:48 UTC | |
by BrowserUk (Patriarch) on Sep 13, 2010 at 16:10 UTC | |
by ikegami (Patriarch) on Sep 13, 2010 at 16:25 UTC |