45 ms·
It's a delayed evaluation, as I understand it?
by pmarreck 2y ago
It's a delayed evaluation, as I understand it?
- alexisread 2y agoThat's the way I tend to read it. The fun bit then is applying context at eval time. Rebol allows you to use a block as a list/function/thunk, which is lazily evaluated. This changes the scoping in that you BIND a context to this thunk. It's a different take on process migration in that the context can be serialised with the thunk, or a new context applied at the process site. This is in contrast to lexically scoped lambda functions which then need to account for dynamic (free) variables somehow.
- kazinator 2y agoThere is a usage of thunk in the context of implementing a compilation strategy for call-by-name arguments. The usage survives into modern times, whereby lambda arguments are sometimes called thunks.