Merge RFC 3513: Add `gen` blocks · rust-lang/rfcs@bc01ed8 · GitHub
source link: https://github.com/rust-lang/rfcs/commit/bc01ed83c19bd96fdd2eb7b7c83c0f1e45f877a9
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Commit
gen
blocks
Browse files Browse the repository at this point in the history
The FCP for RFC 3513 completed on 2024-03-23 with a disposition to merge. Let's merge it.
803 changes: 803 additions & 0 deletions 803
2 comments
on commit bc01ed8
It's a pity that this needs two keywords. Given that this will be fairly rare, a little more cumbersome syntax like yield in { … yield … }
should be tolerable.
Or, if you go for postfix yield { … expr.yield … }
.
Functions have no ambuiguty yield fn … { … expr.yield … }
.
actually, i expect it to be relatively common, e.g. in python generators are pretty commonly used, I expect Rust to be somewhat similar
Please sign in to comment.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK