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

Return as variable #169

Closed
bvssvni opened this issue May 16, 2016 · 0 comments
Closed

Return as variable #169

bvssvni opened this issue May 16, 2016 · 0 comments

Comments

@bvssvni
Copy link
Member

bvssvni commented May 16, 2016

Dyon allows you to assign a value to return, as if it was a normal local variable:

fn foo() -> {
     return = 4
     return = 5
     // will return 5
}

This requires -> on the function.

The return value outlives the arguments of the functions, unless they have a lifetime. If you assign to it, the right expression must outlive 'return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant