Rust’s closure syntax is a little on the heavy side:
It stutters the arg name, and the pipes have lost some of their appeal with the removal of the
Compare to Scala’s compact form:
Groovy has something similar, the
I’ve seen this mentioned for Rust in passing in other places, but I haven’t seen it discussed head-on yet, so: how about a compact syntax for closure args?
I’m personally not crazy about
it, especially for multi-arg closures. I was thinking something like:
which would allow you to specify positional arguments out-of-order, though I’m definitely not tied to this particular sigil or syntax and would be fine with
it, or something else.