-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
defer, %defer, and ?defer #110
Comments
also defer only valid at statement level now see #110
Not sure how it would take shape, but it would be nice to be able to assign and defer in one go (sugar wise). Something to this effect:
Further sugared:
With the implication being that deallocate_foo just takes one parameter that is foo. |
The point of this syntax is so that the deallocation becomes "attached" to the allocation and you can't accidentally separate them. Is that right? |
No, it's just sugar to make it so you can write less code. |
Moved to individual issues. |
defer expr
, evaluates expr when control flow leaves scope%defer expr
, evaluates expr when control flow leaves scope by returning an error from the function?defer expr
, evaluates expr when control flow leaves scope by returning null from the function%return
in a function with void return type%return
returns it is for sure an error. otherwise we have to do a runtime check to find out if it's an error and then do the defer expressionreturn
in a defer.The text was updated successfully, but these errors were encountered: