Skip to content
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

Lone finally block provides cleanup for rest of block #1566

Merged
merged 1 commit into from
Nov 3, 2024
Merged

Conversation

edemaine
Copy link
Collaborator

@edemaine edemaine commented Nov 3, 2024

As discussed on Discord, this seems like a more ergonomic form of using in many cases, and quite intuitive. Also matches Swift's defer) and Zig's defer.

Only supported at the statement level.

Performance penalty seems minimal, so little motivation to combine finally blocks.

Copy link
Contributor

@STRd6 STRd6 left a comment

Choose a reason for hiding this comment

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

Wow, I'm amazed at how simple this was!

Glad to get this in so we can start playing around 👏

@edemaine edemaine merged commit 39fd84a into main Nov 3, 2024
4 checks passed
@edemaine edemaine deleted the finally-block branch November 3, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants