FAQ

On Thu, Nov 1, 2012 at 3:42 PM, Job van der Zwan wrote:
On Thursday, 1 November 2012 08:00:08 UTC+1, Stephen Day wrote:

He's actually asking for destructing assignment, which is unsupported in
Go.

Do you mean destructuring assignment? I just googled "destructing
assignment" and that's what it returned instead. In either case, I had
never heard of the term before (so thanks for introducing me to it), but it
looks to me that even if Go did support destructuring assigment, it
shouldn't support it in this case: there's no way for the compiler to know
what the length of the returned slice would be, so there's no way to guess
if assigning to three variables is legal or not. Unless it would something
like "just assign the first three values of the slice, and if the slice is
smaller assign zero", which sounds like a horrible idea to me.
right. if we had a tuple type, this destructuring assignment would be
possible.

--

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 22 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 31, '12 at 9:15a
activeNov 2, '12 at 7:51a
posts22
users11
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase