Re: Closures versus objects
"Spencer Schumann" <[email protected]>
| Newsgroups | gmane.comp.lang.lightweight |
|---|---|
| Message-ID | <[email protected]> |
> > For example, in Java, anonymous > > inner classes can refer to bindings in the environment in which they > > were created - as long as these bindings are declared final (i.e. they > > are constant). > > No offense, but this Java 'feature' always makes me LOL. If a > binding is constant, is it really a binding? > That's the way it is in Haskell, too, since it lacks mutable state. Of course, without first class functions, programming in a functional style with Java is painful. Trying to program in a *pure* functional style in Java would be downright insane.