in reply to Re^4: order of arguments evaluated
in thread order of arguments evaluated
It's certainly possible to benefit from it. For example:
my $a = 5; foo(0, $a+1, 2, $a+3);
Can be optimized by a massive reordering of the computation. Two of the subexpressions can be evaluated at compile time!
More generically, your view of compiler and runtime optimizations is too narrow in my view. It's more than just registers. It's entirely possible that operations might be reordered to improve cache coherency, or for other considerations.
Updated to remove one objection below: added "my"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: order of arguments evaluated
by BrowserUk (Patriarch) on May 17, 2005 at 18:40 UTC | |
by kscaldef (Pilgrim) on May 17, 2005 at 21:18 UTC | |
by BrowserUk (Patriarch) on May 17, 2005 at 21:40 UTC |