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
Add documentation for meta variable expressions #1485
base: master
Are you sure you want to change the base?
Conversation
@@ -195,6 +195,220 @@ compiler knows how to expand them properly: | |||
not have the same number. This requirement applies to every layer of nested | |||
repetitions. | |||
|
|||
## Meta variable expressions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Meta variable" should be "metavariable" for consistency with everything else. Ditto for all other appearances of the phrase.
@@ -195,6 +195,220 @@ compiler knows how to expand them properly: | |||
not have the same number. This requirement applies to every layer of nested | |||
repetitions. | |||
|
|||
## Meta variable expressions | |||
|
|||
Give access to additional metadata about meta variables that otherwise would be difficult or even impossible to get through elements such as `count` or `index`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elements such as
count
orindex
.
The wording implies that count
and index
are "elements" through which it would be difficult or impossible to get metadata, but presumably that's not the intention.
} | ||
``` | ||
|
||
### length(depth) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bikeshedding, but should consider changing the name to "len". Length is abbreviated to "len" everywhere in std; there is only a single, unstable, API that uses "length".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdahlstrom you may want to bring that up on the implementation PR, currently under FCP proposal rust-lang/rust#122808
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tgross35 Indeed, done!
Requested in rust-lang/rust#122808