We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
EXPR
for PATTERN in EXPR { }
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
https://doc.rust-lang.org/reference/expressions/loop-expr.html#iterator-loops
I was reviewing a test cleanup PR rust-lang/rust#141974, and I was trying to say something about the EXPR in
for PATTERN in EXPR { // ^--- what is this expr called? // ... }
but I couldn't find a good term for this12. The current grammar calls this EXPR
Expressionexcept struct expression
whereas for e.g. match EXPR { .. } or if let PATTERN = EXPR { .. }, there's a more "meaningful name" for that EXPR, which is the scrutinee expr.
match EXPR { .. }
if let PATTERN = EXPR { .. }
In the community discord, terms like "interatee" or "iterable" or "into-iterable" were suggested, but yeah. ↩
Nadrieril came up with "loopee", which is an excellent term 😆 ↩
The text was updated successfully, but these errors were encountered:
Do they all need a name though?
Should the borrow expression call it borrowee ?
And the deref expression, dereferencee ? (We may use pointer here, but you get the gist.)
Just say what EXPR can be, which is done in the document.
IteratorLoopExpression : for Pattern in Expression except struct expression BlockExpression
And to an extent, the traditional iterator seems fine to me, but I'd not add an extra label.
for expression extracts values from an iterator, looping until the iterator is empty.
Sorry, something went wrong.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Location
https://doc.rust-lang.org/reference/expressions/loop-expr.html#iterator-loops
Context
I was reviewing a test cleanup PR rust-lang/rust#141974, and I was trying to say something about the
EXPR
inbut I couldn't find a good term for this12. The current grammar calls this
EXPR
whereas for e.g.
match EXPR { .. }
orif let PATTERN = EXPR { .. }
, there's a more "meaningful name" for thatEXPR
, which is the scrutinee expr.Footnotes
In the community discord, terms like "interatee" or "iterable" or "into-iterable" were suggested, but yeah. ↩
Nadrieril came up with "loopee", which is an excellent term 😆 ↩
The text was updated successfully, but these errors were encountered: