News for hackers. Stuff that matters.
Re:Closures and Objects Are Equivalent (2013) by inopinatus on Sunday November 20, 2022 @04:07AM (#33679485)
> What can you do with a closure? You can call it. What can you do with an object? You can not call it. You can only call one of its methods.

These are congruent, assuming an Alan Kay-ish definition of OOP (as per Smalltalk and Ruby et al). A collaborator object does not call another object's methods, but rather sends it a message. Consequently, there is only one logical interface.

This is one reason that Erlang is sometimes described as one of the most OOP languages, despite possessing distinctly functional fundamentals.

There are no comments on this comment yet.