-
Notifications
You must be signed in to change notification settings - Fork 59
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
Support tuple return type #255
Comments
hey @katat is it fine if I take this up? |
yes it would be great to have a tuple type! sg @0xnullifier |
So just some general doubts @katat @mimoo : I have to make The member access should be we go with the rust style like : And do I have to implement destructuring also? meaning something like fn returns_tuple() -> (Field, Bool) {}
fn main() {
let (x , y ) = returns_tuple();
} |
there should be some type checking right, as you will need to make sure that the returned tuple matches the signature, and on the caller side you need to give the correct type to the returned var. member/array access... personally I think Rust should have done array access so I'd prefer array access :D regarding destructuring, I'd say do what is easier for now (destructuring or access) and we can implement what's left in another PR (because both are good) |
Yup what i was trying to say for the internal structure withing in the tupple like obvs tuples of
Got it we will do array access
maybe if it is easier to implement then I will also try this |
Tuple return type can be useful when it needs to return more than one type from a function, avoiding the need to duplicate functions into two versions just for different return types.
For example:
Without the support of tuple type, this function has to be duplicated with the only difference in the return type.
The text was updated successfully, but these errors were encountered: