Objects vs Closures

Filed under: meta programming+paradigms 

I've finally come to the understanding (somewhat belatedly) that there isn't a lot of difference between an object and a closure. Once again, I'm forced to admit that the Lisp/Scheme people were right all along.

I came across a message from Guy L. Steele regarding the distinction (or lack of) where he states:

A closure is an object that supports exactly one method: "apply".

But of course, this is actually true of objects as well. If the object itself is considered a closure, and each of the object's methods is also a closure, then what you are left with is nested closures, each with one method: "apply". The distinction seems more semantic (i.e. how you choose to view it) than fundamental.



1 comments Leave a comment