Given #ideas > braces syntax, could we improve the argument syntax (||)?
E.g. using \:
\foo, bar {
look_ma!(foo, bar)
}
\foo, bar { "${foo} in the name of ${bar}" }
|| is familiar to many through Ruby and Rust. It also delimits the args clearly (although we now have { as a known delimiter after args anyway).
\ is known as lambda to many some, it's one character instead of two (and now we have a known delimiter after args {), and unlike | it doesn't require a modifier to type on US (and many other?) keyboard layouts.
I don't feel strongly about this, but realized that there's a new opportunity here given {.
I don't think \ is known as lambda to many, that was a discussion point (discussion in giant air quotes) on the HN thread about the Zig rewrite
Also, lambdas might not have braces if they are one liners, so we'd maybe write this with your proposed syntax: \foo, bar look_ma!(...)
mmm, wouldn't that be something? ;)
Nah, that's true, I was thinking that braces are used for one-liners too
It wouldn't be great to need braces for list.map(|x| { x * 2 }), that's just more noise
Niclas Ahden has marked this topic as resolved.
Last updated: Jun 16 2026 at 16:19 UTC