Preparing for the 0.2 draft

John Rose John.Rose at Sun.COM
Tue Feb 2 17:53:52 PST 2010


On Feb 2, 2010, at 5:42 PM, Joshua Bloch wrote:

> I think it was with good reason that
> Alex made the parens mandatory.

Thanks; my bad.  I wasn't trying to subvert that part of the spec.

> I believe it was a mistake to require (Integer)(128) to create a
> new instance, and I don't think we should make that mistake twice.

It doesn't!  The spec. requires caching in the range [-128,127], but does not disallow caching elsewhere.  That's the practical basis for proposing fixnums as a future JVM optimization.  (Or maybe I'm missing your point?)

> I'd like it if the syntax for creating an instance
> of a Sam type was just as nice as for creating an instance of an ordinary
> function type. 

The good old syntax dial has many gradations.  The dial setting I picked made sam instantiation "almost as nice but not quite, yet strangely familiar" (compared to a simple lambda) to take explicit control over constructor invocation and instance identity.

The most implicit option (assignment conversion) has lots of corner cases with need sorting out.  That option should (as I think we agree) allow (though not require) implementations to hoist and/or cache, just as with Integer.

Best wishes,
-- John


More information about the lambda-dev mailing list