Replies: 5 comments 1 reply
-
As this is in discussions: Some thoughts and roaming:
Could also see a marker attribute |
Beta Was this translation helpful? Give feedback.
-
For record fields
|
Beta Was this translation helpful? Give feedback.
-
Yeah, the key difference is that for tables |
Beta Was this translation helpful? Give feedback.
-
Yeah, that all makes sense to me. I just read over the |
Beta Was this translation helpful? Give feedback.
-
Implemented in #3179 |
Beta Was this translation helpful? Give feedback.
-
The semantics of
&default
are that the given value (expression) is returned if the corresponding field or table entry is missing. Often it would be handy for that value to then also be assigned to the field or inserted into the table. This especially comes up when the default value is a container. For example,prints
{ }
(an empty table), not a table with[5] = [a=7]
like you might expect.Proposal: add
&create_default=
expr to mean that missing entries should be initialized to the given expression upon first access.Beta Was this translation helpful? Give feedback.
All reactions