Hi again, just wondering if a shorthand syntax is being/has been considered for passing a record as the only argument to a function?
I know that syntax discussion like this can be a bit of a distraction, but I just thought I should make the case for allowing (in PNC):
f{x, y}
f{x: 1, y: 2}
as sugar for
f({x, y})
f({x: 1, y: 2})
given that anonymous records are the idiomatic and only way to do named arguments.
I'm not entirely convinced, as I found the syntax in Lua a tiny bit of a surprise when I was a beginner, and have no idea how this interacts with the rest of parsing or the Roc ethos, but thought it was worth asking?
I'd like to keep it as is for simplicity but it is something we can consider some time in the future.
Fair enough, thanks!
Jonathan has marked this topic as resolved.
Last updated: Jul 06 2025 at 12:14 UTC