Post

My #rustlang take for today is that a function accessed through method notation (val.method) but not called (so, without brackets) should evaluate to a closure of a form |arguments| { val.method(arguments) } Currently it evaluates to a function pointer

This is basically partial application but less boilerplate-ry than making a whole new closure and is also specific for method notation

This comes from having a "context" struct with a method wrap<T>(&self, v: T) -> Wrapper<T> where the wrapper contains the value and reference to the shared context

0 reposts0 likes

No replies yet.