Thanks for your feedback @bastian!
I have submitted a PR https://github.com/onflow/flips/pull/36 to update the attachments proposal with your suggestions.
Thoughts on the dedicated syntax for access: I like the r[A]
syntax for access, but I think this would require a breaking change to Cadence to make possible. Cadence currently has separate namespaces for types and values, but if we allowed people to use indexing syntax with types, we might run into ambiguities if a type and a value share a name. What about something like r<A>
? The angle brackets are already associated with types, since we use them with generic parameters.
Regarding the order of evaluation for attach
, I like the prefix operator because it approximates natural language: attach <ATTACHMENT> to <VALUE>
reads more naturally than <VALUE> attach <ATTACHMENT>
or similar. However, I agree that as described it needs to be right-to-left evaluated; this was not an issue with the old syntax of extend <VALUE> with <ATTACHMENT>
.