catb0t / tart

Automatically exported from code.google.com/p/tart
0 stars 0 forks source link

Implement bound methods #22

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
A reference to a method should be equivalent to a closure with the same calling 
signature. This may require generating a calling adaptor in the compiler. For 
example:

class Foo {
  def bar() {
    Console.out.writeLn("Hello!");
  }
}

let obj = Foo();
let func = obj.bar;
func(); // Should print "Hello!"

Original issue reported on code.google.com by viri...@gmail.com on 1 Mar 2011 at 10:42