in reply to Perl and common subexpressions
Unfortunately, unlike C, Perl has to contend with something a little crazier: Tied hashes and arrays.
And function calls. In
any of y, z, or a can be methods, with or without side-effects, and with no guarantee that they'll return the same thing on subsequent calls. In the face of such flexibility, static analysis optimizations are non-starters.t = x->y->z->a->b[5];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl and common subexpressions
by theorbtwo (Prior) on Dec 23, 2004 at 15:08 UTC |