Post by email@example.com
The closure is a function that has access to the locals, that is,
closure is the function with the local data, which has same
meaning of Object with one function in Object-Oriented
As Torben has said, there is a lot of similarity.
Compared to class based OO, closures are a more general concept
because they can, at run time, bind arbitrary functions to arbitrary
data without the need for prior declarations. Several early Lisp
object systems were based on this ability.
Using closures AS objects is similar to so-called "template" or
"prototype" OO, in which there is no real distinction between class
and instance: object data structure and member function associations
can be changed at run time, and objects are created by "cloning" a