in reply to Re^4: map in void context
in thread map in void context
This seems disingenuous. While I agree that arguing that assignment is “side-effect free” seems a little strange, your example isn't just assigning, it's mutating. Even in the purest of functional languages, x = 5 is OK (I think!); but x += 1 isn't.I don't consider assignment to have a "side effect". Assignment is the effect.So,is side-effect free?map {$sum += $_} @array;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: map in void context
by JavaFan (Canon) on Dec 18, 2008 at 10:14 UTC |