Skip to content

Commit

Permalink
Merge RFC 3513: Add 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.
  • Loading branch information
traviscross committed Apr 7, 2024
2 parents 0044bb7 + 22f7267 commit bc01ed8
Showing 1 changed file with 803 additions and 0 deletions.

2 comments on commit bc01ed8

@daniel-pfeiffer
Copy link

@daniel-pfeiffer daniel-pfeiffer commented on bc01ed8 Apr 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 … }.

@programmerjake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.