in reply to Possible bug with array pointer
Hi jockel,
That's the intended behavior. See Foreach Loops (emphasis mine):
If any element of LIST is an lvalue, you can modify it by modifying VAR inside the loop. Conversely, if any element of LIST is NOT an lvalue, any attempt to modify that element will fail. In other words, the foreach loop index variable is an implicit alias for each item in the list that you're looping over.
Hope this helps,
-- Hauke D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Possible bug with array pointer
by jockel (Beadle) on Jan 10, 2017 at 18:59 UTC | |
by Athanasius (Archbishop) on Jan 11, 2017 at 03:34 UTC | |
by jockel (Beadle) on Jan 11, 2017 at 14:36 UTC | |
by Marshall (Canon) on Jan 11, 2017 at 01:40 UTC | |
by jockel (Beadle) on Jan 11, 2017 at 14:43 UTC | |
by haukex (Archbishop) on Jan 11, 2017 at 14:57 UTC |