▲ | masklinn a day ago | ||||||||||||||||||||||
> The weird "return tuple" , which obviously just exists for errors because there is not a single other place where you can use tuples in the language MRV, go does not have tuples. Go is not the only language with MRV (as a special case) and they’re not necessarily bad, iirc Common Lisp uses them as auxiliary data channels and has a whole host of functions to manipulate and refit them. Go is singularly incompetent at MRVs though, in the sense that only syntax and builtin functions get access to variable arity (e.g. if you access a map entry you can either get one return which is a value, or two which are the value and whether the key is/was in the map). So MRVs mostly end up being worse tuples infecting everything (e.g. iterators needing Iter and Iter2 because you can’t just yield tuples to for loops). | |||||||||||||||||||||||
▲ | robocat a day ago | parent | next [-] | ||||||||||||||||||||||
> MRV Acronym for Multiple Return Values https://gobyexample.com/multiple-return-values | |||||||||||||||||||||||
▲ | pwdisswordfishz a day ago | parent | prev [-] | ||||||||||||||||||||||
> MRV, go does not have tuples. > MRVs mostly end up being worse tuples I think you noticed yourself that you’re getting too hung up on terminology. Multiple return values are a half-hearted, non-reified version of tuples. | |||||||||||||||||||||||
|