in reply to Re^3: $1 not "freezing" in an addition
in thread $1 not "freezing" in an addition
"It ought to be easy to recognize an unquoted $1 as a function argument and issue a warning"
The problem occurs in:
return $1 + sub_that_does_regex_capturing(...);
$1 is not a function argument in that. $1 hasn't been a function argument in any of the examples in this thread.
The problem is writing an expression where one of the operands has a side-effect that can alter the value of another operand. This is very hard to detect through static analysis of source code; it's probably not especially easy to detect at run-time either. Heuristics may be able to catch some common cases.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: $1 not "freezing" in an addition
by grondilu (Friar) on Dec 14, 2012 at 15:36 UTC | |
by tobyink (Canon) on Dec 14, 2012 at 16:03 UTC | |
|
Re^5: $1 not "freezing" in an addition
by Anonymous Monk on Dec 14, 2012 at 16:14 UTC | |
by chromatic (Archbishop) on Dec 14, 2012 at 18:10 UTC | |
by Anonymous Monk on Dec 15, 2012 at 08:40 UTC | |
by chromatic (Archbishop) on Dec 15, 2012 at 20:25 UTC | |
by Anonymous Monk on Dec 16, 2012 at 01:18 UTC | |
|