3 ms·
Isn't that an effect, not neccesarily a side effect?
by kazagistar 13y ago
Isn't that an effect, not neccesarily a side effect?
- mturmon 13y ago"Function with side effect" is a term of art in functional programming. It's a function which (like all other functions) takes in arguments and puts out arguments (that's the "effect", if you like). But also, with a "side effect" -- the simplest example being, display something on the monitor. I.e., (display "hello world") returns whatever it returns (we throw it away), but also puts that string on the monitor. The latter action is not just computing a function (in the sense of FP) of the inputs. For more, see http://www.eecs.berkeley.edu/~bh/ssch20/io.html http://www.eecs.berkeley.edu/~bh/ssch20/io.html (search for "side effect").