Closed
Description
Make it legal to do the following:
obj foo() {
fn add5(n: int) -> int {
ret n + 5;
}
}
fn add5(n: int) -> int {
ret n + 5;
}
fn main() {
let fiveplusseven = bind add5(7);
log_err fiveplusseven();
// Can't do this currently
let my_foo = foo();
let fiveplusseven_too = bind my_foo.add5(7);
log_err fiveplusseven_too();
}
This feature would make it possible to reify methods as standalone functions. (I haven't thought through all the implications of this; I suppose the resulting function would have to capture the object in its scope.)