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

Easier cleanup on function return #334

Closed
jclark opened this issue Sep 16, 2019 · 2 comments
Closed

Easier cleanup on function return #334

jclark opened this issue Sep 16, 2019 · 2 comments
Assignees
Labels
Area/Lang Relates to the Ballerina language specification Type/Improvement Enhancement to language design

Comments

@jclark
Copy link
Collaborator

jclark commented Sep 16, 2019

Go provides the defer statement which makes it easy for functions to ensure that cleanup (e.g. closing a file descriptor) is performed on any return from the function.

It would be nice if Ballerina provided similar functionality.

This may be related to the programming model for transactions #267.

@jclark jclark added Type/Improvement Enhancement to language design Area/Lang Relates to the Ballerina language specification labels Sep 16, 2019
@jclark jclark added this to the 2020Rn milestone Sep 16, 2019
@jclark jclark self-assigned this Sep 16, 2019
@jclark jclark changed the title Easier cleanup on error Easier cleanup on function return Sep 16, 2019
@jclark jclark modified the milestones: 2020Rn, 2020R1 Sep 20, 2019
@jclark
Copy link
Collaborator Author

jclark commented May 8, 2020

Swift has defer blocks.

@jclark
Copy link
Collaborator Author

jclark commented Aug 6, 2020

We are dealing with this in #337.

@jclark jclark closed this as completed Aug 6, 2020
@jclark jclark removed this from the Swan Lake preview milestone Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Lang Relates to the Ballerina language specification Type/Improvement Enhancement to language design
Projects
None yet
Development

No branches or pull requests

2 participants