Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not sure I see a difference between thunks and futures.


Thunk is a general concept of a small function which is used only to adapt the call or prepare/modify it in some way and then redirect to the proper function. Things like promises, futures, closures, wrappers, stubs or implementations of the concept of virtual function tables in some OO languages (like C++) are just special use cases of thunks (thunks are often used to implement them).

Source: https://stackoverflow.com/a/22548372/309483


The definition that the source is using seems wrong to me. Promise,futures and closures are not used to redirect to anything or wrapper around something else... They are proper compationational object with they own behaviors...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: