Groovy closures are just objects as well, but they can't easily be serialized because they can capture references to other objects which are unlikely to exist on the far machine.
Can you say more about the compiler plugin? Or provide a pointer? Also, in your example here, how would you deal with the situation where a is incremented in map closure? Just punt and say undefined? On Wed, Mar 25, 2009 at 1:23 PM, David Hall <d...@cs.stanford.edu> wrote: > scala closures are just objects. With the compiler plugin I wrote it's > trivial to to serialize closures and send them down the wire. In fact, > that's how SMR works at the moment. > > int a = 3; > > for( (k,v) <- pairs) yield (v,k+ a) > > translates to > > pairs.map( new anonfun$obfuscationgarbage$1(a) ) > -- Ted Dunning, CTO DeepDyve