[go-nuts] Assigning multiple return values of a single func to multiple variables?
Nov 1, 2012 at 8:21 am
Or make it possible only if the value to be destructed is an array (with a specific length).
: right. if we had a tuple type, this destructuring assignment would be possible. --
: Hi minux, Have you seen any reason for Go to get Tuples? --
: Tuples are essentially just arrays... or structs... depending on what you're trying to do. If you consider something like python, where you can construct a tuple of any length at runtime, then tuples are like slices. In any case, Go already has all three work-alikes, and it seems it'd break the orthogonality thrice-ways if "tuples" were added. I don't see this "destructuring assignment" couldn't be done with slices, as something of the inverse of how variadics are handled. You extend `...` to
: I agree with Kevin. I can't see how I would need this feature (I haven't so far, anyway). How often do you return a variable number of arguments and don't want a slice? Why wouldn't you want a slice? --
[go-nuts] saving local variables within a function
Re: [go-nuts] Setting cgo variables based on environment
[go-nuts] Strange display of variables of interface type in godoc's output
[go-nuts] Named string format variables?
[go-nuts] Cgo issue: Got wrong value of exported variables in a DLL
[go-nuts] html/template question about variables
[go-nuts] Get variables names
[go-nuts] go get <url> by proxy with character @ "at"
[go-nuts] Setting cgo variables based on environment
[go-nuts] Re: Eclipse Plugin Announcement
8 of 22
Oct 31, '12 at 9:15a
Nov 2, '12 at 7:51a
11 users in discussion
Michael Jones (3)
Job van der Zwan (3)
Stephen Day (2)
Kevin Gillette (1)
Francisco Souza (1)
Rory McGuire (1)
Philipp Schumann (1)
Thomas Bushnell, BSG (1)
Groups & Organizations
site design / logo © 2021 Grokbase