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

Go: Support for multiple return values #27

Open
robskie opened this issue Oct 9, 2015 · 6 comments
Open

Go: Support for multiple return values #27

robskie opened this issue Oct 9, 2015 · 6 comments

Comments

@robskie
Copy link

robskie commented Oct 9, 2015

Will multiple return values be supported for Go?

@Maratyszcza
Copy link
Owner

No plans for that

@robskie
Copy link
Author

robskie commented Oct 10, 2015

Ok.

@robskie robskie closed this as completed Oct 10, 2015
@Maratyszcza
Copy link
Owner

Please leave the issue opened. Probably somebody else would want to implement it.

@dgryski
Copy link

dgryski commented Dec 4, 2016

Documentation:

Multiple return values in Go are passed on the stack after the arguments. They are addressed relative to FP. It seems that RETURN could be special-cased to take a tuple or a list, and then just assign to successive slots.

@siddhesh503
Copy link

@Maratyszcza @dgryski it would be great if it is supported. I want to write the sum of int64 slice with int64 overflow check.
func AddInt64Slice(s []int64) (int64, bool) bool here will return if the overflow happened or not.
In the meanwhile, is there a workaround for getting multiple return values from the function? is it possible to have dummy int64 slice as a function parameter and store the result like [int64sum, overflowstatus(0/1)]?

@dgryski
Copy link

dgryski commented Aug 24, 2021

@siddhesh503 avo supports multiple return values (but of course requires that you port your asm code from peachpy to avo).

https://github.com/mmcloughlin/avo

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

4 participants