Closed damon-kwok closed 4 years ago
Can you provide some motivation for why this would be desirable? Every RFC should contain some motivation as to why it is desirable. Even requests.
Please note in case you are aware. Opening an issue such as this is a request for another human (other than you) to write up the full RFC so the more details you provide them, the better.
I'm not sure of your motivation, but I suspect that you can already do it using partial application:
primitive Foo
fun hello(x: String): String =>
"hello " + x
actor Main
new create(env: Env) =>
print_with_y(env.out, Foo~hello())
fun print_with_y(stream: OutStream, f: {(String): String} val) =>
stream.print(f("there"))
Runnable at the playground:
https://playground.ponylang.io/?gist=7ac613b68b129c7588e828e904fcbd03
Thanks @SeanTAllen This is exactly what I wanted. I am so sorry for this issue.
Primitives methods as lambda
If you call the primitive method without parentheses, the call is automatically wrapped as lambda
Example