Serialization

Alex Blewitt alex.blewitt at gmail.com
Wed Dec 16 01:14:41 PST 2009


On Wed, Dec 16, 2009 at 9:06 AM, Peter Levart <peter.levart at marand.si> wrote:
> For the "name" part, maybe alternative is specifying it directly in the lambda expression like this:
>
> #int(int, int) plus = #(int a, int b) a+b; // produces annonymous class name, sensitive to position in source

Why can't we just serialize they bytecode associated with a lambda?
Provided that it's a static lambda (e.g. one that has no references to
'this') and captures no state (i.e. it's not a closure), we could just
stream the bytecode that makes up the function itself. Ergo, make
non-instanace, non-closure lambdas serializable, and make any lambda
that captures (non-final?) scope non-serializable.

I don't see that the name is at all relevant, since the name is part
of the variable that it gets assigned to and not an intrinsic property
of the lambda itself.

Alex


More information about the lambda-dev mailing list