3 ms·
Yes, but it can go a bit further. http://c2.com/cgi/wiki?ClosuresAndObjectsAreEquivalent http://c2.com/cgi/wiki?ClosuresAndObjectsAreEquivalent A singular clo
by Jtsummers 12y ago
Yes, but it can go a bit further.
http://c2.com/cgi/wiki?ClosuresAndObjectsAreEquivalent http://c2.com/cgi/wiki?ClosuresAndObjectsAreEquivalent
A singular closure is 1+ data bound to an entity (function). A singular object is multiple data/functions bound to one entity (object).
In the link above there are examples of either generating multiple closures tied to the same set of data (like tel's example), and also examples of having a singular closure that takes as a first parameter a "method" name and branching based on that. Using either solution you have an OO system using closures as your basis.