There's a problem that sometimes comes up with recursive references to record fields, which is that a field name can be defined to a value that is not a valid identifier in other contexts. That can make it impossible to reference some record fields recursively. For example, a record field with the same name as a keyword can't be referenced:
nickel> { priority = "high", x = priority }
error: unexpected token
┌─ <repl-input-3>:1:26
│
1 │ { priority = "high", x = priority }
│ ^^^^^^^^
Another example is field names with a period:
nickel> { "some.property" = 1, x = some.property }
error: unbound identifier `some`
┌─ <repl-input-4>:1:28
│
1 │ { "some.property" = 1, x = some.property }
│ ^^^^ this identifier is unbound
One solution that I think was discussed in the discord a while back is to have a way to create raw identifiers, like id%"some.property"%.
There's a problem that sometimes comes up with recursive references to record fields, which is that a field name can be defined to a value that is not a valid identifier in other contexts. That can make it impossible to reference some record fields recursively. For example, a record field with the same name as a keyword can't be referenced:
Another example is field names with a period:
One solution that I think was discussed in the discord a while back is to have a way to create raw identifiers, like
id%"some.property"%.