3 ms·
R's evaluation of arguments is lazy, so while not at the level of Haskell it feels like a lazy language to me. Try eg: f = function(x) { print('hello'); x }
by aquasync 2y ago
R's evaluation of arguments is lazy, so while not at the level of Haskell it feels like a lazy language to me. Try eg:
f = function(x) { print('hello'); x }
f(print('world'))
X is not evaluated in f until referenced. Indeed if you remove x from f, world is not printed.