jckarter/clay — Issue #76: Delegation
Author: jckarter
Created: 2011-12-20 18:52:46+00:00
State: closed
Labels: language-feature, v0.2

Delegation could be faked with universal overloads, but it would be more efficient and readable to have it built-in. General idea:

```
record Foo (foo:Int);
delegate (x:Foo) = ref x.foo;

bar(x:Int) = x + 1;
main() { println(bar(Foo(1))); } // prints 2, because bar(Foo) is delegated to bar(Int)
```