PeachPy
PeachPy copied to clipboard
Go: Support for multiple return values
Will multiple return values be supported for Go?
No plans for that
Ok.
Please leave the issue opened. Probably somebody else would want to implement it.
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.
@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)]?
@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