2 ms·
How do you then distinguish between referring to a function with no / empty arguments, and invoking that function? Functions are no arguments (aka thunks) are u
by noelwelsh 2y ago
How do you then distinguish between referring to a function with no / empty arguments, and invoking that function? Functions are no arguments (aka thunks) are useful in a number of contexts (pun intended!) and it's kinda the point that they are not immediately invoked.
- layer8 2y agoYeah, this kind of automatism turns nullary functions into brittle things where you never know when or how often they get evaluated. Even if you have no side-effects, a potentially expensive computation is in itself a side-effect that you want to control when it happens. A nullary function is a different type from its return type, and should better be handled as such.
- deleted 2y ago[deleted]
- middayc 2y agoRye like Rebol uses get-words for getting the value of the word, for example a function versus evaluating it.