We currently use the following syntax for record updates:
updatedRecord = { record & foo: 123, bar: "abc" }
Which can be short-handed for a single field with record |> &foo 123.
We also want to support a different syntax:
updatedRecord = { foo: 123, bar: "abc", ..record }
Since we have two existing syntaxes for record updates that both use the &, if we were to remove the old syntax now, we'd still have the &foo shorthand syntax. As such, we should support both syntaxes, and after looking at how the code falls out, pick a syntax based on whether we prefer the & consistency, or ..record consistency with the other ..-based changes being made in https://github.com/roc-lang/roc/issues/7091.
We currently use the following syntax for record updates:
Which can be short-handed for a single field with
record |> &foo 123
.We also want to support a different syntax:
Since we have two existing syntaxes for record updates that both use the
&
, if we were to remove the old syntax now, we'd still have the&foo
shorthand syntax. As such, we should support both syntaxes, and after looking at how the code falls out, pick a syntax based on whether we prefer the&
consistency, or..record
consistency with the other..
-based changes being made in https://github.com/roc-lang/roc/issues/7091.