4 ms·
> If there's anything that is not an object, it's a function! Why, functions have state -- their closure.
by deepsun 11mo ago
> If there's anything that is not an object, it's a function!
Why, functions have state -- their closure.
- knome 11mo agoclosures and objects with a single invoke() method have been considered equivalent in many views for some time.
- deepsun 11mo agoExactly, that's why I disagree with parent's comment: > If there's anything that is not an object, it's a function!
- Jtsummers 11mo agoFunctions aren't closures. To be a closure it needs to be a function paired with an environment. Functions do not inherently carry their environment with them.
- endgame 11mo agoAncient wisdom: closures are a poor man's objects; objects are a poor man's closures. https://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html https://people.csail.mit.edu/gregs/ll1-discuss-archive-html/...