2 ms·
IO: myand := method( if(call evalArgAt(0), call evalArgAt(1), false) ) myand(true, 3 println) # prints 3 to stdout myand(false, 3 pri
by klibertp 11y ago
IO:
myand := method(
if(call evalArgAt(0), call evalArgAt(1), false)
)
myand(true, 3 println) # prints 3 to stdout
myand(false, 3 println) # nothing happens
This should also be possible in TCL. Scala has some kind of lazily eval'ed arguments, too. And, of course, Haskell has this built-in.
EDIT: better example code.
- klibertp 11y ago(forgot to mention, this IO code generalizes to any number of arguments)