Re: Closures versus objects
| Newsgroups | gmane.comp.lang.lightweight |
|---|---|
| Message-ID | <[email protected]> |
> The big difference for me is purity - a pure object system has
> consistent semantics while a system based on first-class functions
> ends up having both functions and object-like-things built with
> functions. And that non-pure dynamic object code has type
> dependencies, which are at odds with code reuse and flexibility.
>
> - Steve
But what about the idea that closures are a fundamental concept in
computer science, and any sufficiently enlightened language design
should inlcude them? In a functional language, it seems closures are
a natural consequence, and to not have them one would have to go out
of one's way to deliberately break the functional paradigm. And then,
one probably couldn't call it a functional language anymore.
Assuming of course you were referring to language design. If you
mean, "closures are fine to have in a language, but don't use them to
build an OO system", my point is moot.
Regardless I am puzzled by your last sentence. What dependencies are
you talking about? Others have argued that if anything closures have
fewer strings attached than objects.