[plt-scheme] Java Continuations!

From: Anton van Straaten (anton at appsolutions.com)
Date: Wed May 26 20:34:14 EDT 2004

> > > Now if they'd only implement lexical closures in java,
> > > they'd really have something :-/
> >
> > You probably know that Java has lexical closures - in the form
> > of (anonymous) inner classes - it's just that you need the
> > patience of a bushel of saints to use them.
> >
> > Anton
> >
> I call anonymous inner classes a poor man's lexical closures.
> As you probably know, they aren't real closures.  You can
> simulate real closures by passing references to whatever
> data you want to capture in methods and storing them in
> the object, but that's really painful.

They're real closures in the sense that they close over any immutable local
variables in the environment in which they're instantiated -- so you could
say they're real closures with respect to the pure functional subset of
Java.  :)

> C# has real closures as of version 2.0.

Out of the frying pan, into the fire...


Posted on the users mailing list.