3 ms·
Go functions don’t actually semantically return tuples, multiple return is part of the calling convention. It can be changed more easily than in other language
by dontlaugh 1y ago
Go functions don’t actually semantically return tuples, multiple return is part of the calling convention.
It can be changed more easily than in other languages because everyone statically links, but it’s not trivial.
- aatd86 1y agoThey are not first class in the language but I think I remember the compiler having them as a representation for some language objects. Maybe https://go.dev/src/go/types/tuple.go https://go.dev/src/go/types/tuple.go
- pjmlp 1y agoWhile it is the default, dynamic linking has been supported in Go for quite a while.