-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change how we use the term "element" #2631
Comments
@kwalrath The writers have used "element" at two places which caught my attention:
|
#2638 fixed this in the language tour, but we need to make a sweep through other uses. |
|
@munificent : This inconsistency exists as to how we refer to the items in collection structures. This issue wants to move toward using Current terms under consideration are |
I'd probably use "value" when referring to the thing you can get out of a list or set, and "entry" for the key-value pairs a map contains. I do have to say that "element" feels pretty natural to me to refer to the runtime concept of a value returned from a list, and it's a shame that I overloaded the term to mean the syntactic construct. I was never able to come up with a better name for "the kind of thing you can write inside a collection literal". |
I don't remember the context here, but "element" is also okay with me after reading through this issue three years later. |
This came up in a discussion with @johnpryan and @munificent.
"Element" is overloaded to mean "a syntactic construct that can appear inside a collection literal" and "a value that can appear in a collection object". The former is evaluated at runtime and may produce zero or more of the latter.
UI-as-code features like collection if, collection for, and spread are elements in the former sense, but not in the latter.
We should probably move away from using "element" to mean a value in a list object. We can already use "value" or "object" to refer to that and those are clearly runtime terms. So elementAt() returns a value, not an "element" (despite the name).
This affects the language tour and anywhere else that uses the term "element" (up to 34 pages, but some of those probably refer to HTML elements).
The text was updated successfully, but these errors were encountered: