Richard Feldman said:
an easy fix would be changing accessor syntax to be
_.b
Should field access be unique or should we generalize this to "a single underscore in an expression is sugar for unique_name with an expression prefix of |unique_name|"?
foo(_.bar)
foo(_.bar())
foo(_.bar.baz)
foo(_.bar + 1)
foo(bar + _ * 2)
I don't want to scope creep into that
Scala does this and it would be a very big change to how Roc code looks - the last two examples there being the tip of the iceberg
this is the sort of feature that needs to start with a specific pain point, like "______ feels painful to read, and something like _ would make it a lot nicer to read" and then we can weigh that upside against the downsides :big_smile:
because I don't think consistency is enough of a reason to do this
Yeah, this feature has definitely been ask for and pushed back against for anonymous lambdas before.
Last updated: Jun 16 2026 at 16:19 UTC