mth/yeti — pull request #12 by akavel (2014-09-19 21:32:54+00:00)
Title: [DRAFT] lambda to Single Abstract Method class auto-conversion

So, that's my first attempt/PoC at implementing the idea I described on the mailing list. I tested it with the following code:

```
class Runfoo
void run1(java.beans.ExceptionListener f)
f#exceptionThrown(()),
void run2(java.beans.ExceptionListener f)
f#exceptionThrown(new java.lang.RuntimeException("foobar")),
end;
r = new Runfoo();
ff e is ~java.lang.Exception -> () = println "in SAM: \(e)";
r#run1(ff);
r#run2(ff);
```

I still need to add code for generating the class names, and would like to also add some tests to the Yeti testsuite. I've left some TODOs and FIXMEs I also want to resolve; although as to using wrapSamArgs() in `kind == "new"` case I'm on the fence.

What would be your thoughts on this approach and the code?

Also, I couldn't understand what's the meaning of **the "depth" parameter**, which is passed around nearly everywhere; could you give me some hint on that? I'm not sure what value I should use (inserted some random "99" for now). Similarly, is it OK for me to **leave BinOp.parent unset**? I've seen it's being set to something somewhere I think in the parser.

Thanks.