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

Compare Zig defer with Go defer #54

Open
pedropark99 opened this issue Oct 4, 2024 · 0 comments
Open

Compare Zig defer with Go defer #54

pedropark99 opened this issue Oct 4, 2024 · 0 comments
Labels
2ndEdition Something that is planned for the 2nd edition of the book.

Comments

@pedropark99
Copy link
Owner

pedropark99 commented Oct 4, 2024

The Go language have a defer keyword. However, the Go defer is different than Zig defer. Because Go defer is "move expression to function exit", while Zig defer is "move expression to current scope exit".

This difference have a slightly different effect.

https://go.dev/tour/flowcontrol/12

@pedropark99 pedropark99 added the 2ndEdition Something that is planned for the 2nd edition of the book. label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2ndEdition Something that is planned for the 2nd edition of the book.
Projects
None yet
Development

No branches or pull requests

1 participant