Re: [go-nuts] interface array and ... operator

2018-10-25 Thread jake6502
In my defense, neither A() nor B() complies in the actual example given. If you comment out A() you will see that B() then fails to compile. If B() is fixed by replacing "i = append(i, s)" with "i = append(i, sa)", then it succeeds. I believe that is due to the clause I referenced in my mistak

Re: [go-nuts] interface array and ... operator

2018-10-25 Thread Robert Engels
No need. I was just getting very confused trying to follow. > On Oct 25, 2018, at 10:59 AM, jake6...@gmail.com wrote: > > Yes. I was completely mistaken in my post. Apologies. > >> On Wednesday, October 24, 2018 at 12:14:36 PM UTC-4, robert engels wrote: >> I quote >> >> So in the OP's exampl

Re: [go-nuts] interface array and ... operator

2018-10-25 Thread jake6502
Oops. Please ignore my entire post. Misunderstood completely. On Wednesday, October 24, 2018 at 11:55:18 AM UTC-4, Jake Montgomery wrote: > > That is correct. The relevant part of > https://golang.org/ref/spec#Passing_arguments_to_..._parameters is where > it says: " respective parameter passin

Re: [go-nuts] interface array and ... operator

2018-10-25 Thread jake6502
Yes. I was completely mistaken in my post. Apologies. On Wednesday, October 24, 2018 at 12:14:36 PM UTC-4, robert engels wrote: > > I quote > > So in the OP's example https://play.golang.org/p/59bpr8TCIge, the > function A() is assigning a []string to the variadic ...[]interface{}. > Since stri

Re: [go-nuts] interface array and ... operator

2018-10-24 Thread Jan Mercl
Eh, actially the other discusser said that. Me not. I explained why A does not work. On Wed, Oct 24, 2018, 18:08 Jan Mercl <0xj...@gmail.com> wrote: > Nobody said that. > > On Wed, Oct 24, 2018, 18:04 robert engels wrote: > >> I’m confused… it is A that doesn’t work, and B works… everyone keeps

Re: [go-nuts] interface array and ... operator

2018-10-24 Thread robert engels
I quote So in the OP's example https://play.golang.org/p/59bpr8TCIge , the function A() is assigning a []string to the variadic ...[]interface{}. Since string is assignable to interface{}. this is fine. The function B() is assigning a []interface{} to the

Re: [go-nuts] interface array and ... operator

2018-10-24 Thread Jan Mercl
Nobody said that. On Wed, Oct 24, 2018, 18:04 robert engels wrote: > I’m confused… it is A that doesn’t work, and B works… everyone keeps > stating that B doesn’t work and A works…. > > On Oct 24, 2018, at 10:55 AM, jake6...@gmail.com wrote: > > > That is correct. The relevant part of > https://

Re: [go-nuts] interface array and ... operator

2018-10-24 Thread robert engels
I’m confused… it is A that doesn’t work, and B works… everyone keeps stating that B doesn’t work and A works…. > On Oct 24, 2018, at 10:55 AM, jake6...@gmail.com wrote: > > That is correct. The relevant part of > https://golang.org/ref/spec#Passing_arguments_to_..._parameters >

Re: [go-nuts] interface array and ... operator

2018-10-24 Thread jake6502
That is correct. The relevant part of https://golang.org/ref/spec#Passing_arguments_to_..._parameters is where it says: " respective parameter passing rules apply". This links to https://golang.org/ref/spec#Passing_arguments_to_

Re: [go-nuts] interface array and ... operator

2018-10-24 Thread Robert Engels
But it is the varadic one that works according to OP. > On Oct 24, 2018, at 4:19 AM, Jan Mercl <0xj...@gmail.com> wrote: > > On Wed, Oct 24, 2018 at 7:34 AM Mayank Jha wrote: > > > why does A() not work while B works here, > > https://play.golang.org/p/59bpr8TCIge > > Type mismatch. The com

Re: [go-nuts] interface array and ... operator

2018-10-24 Thread Jan Mercl
On Wed, Oct 24, 2018 at 7:34 AM Mayank Jha wrote: > why does A() not work while B works here, https://play.golang.org/p/59bpr8TCIge Type mismatch. The compiler is clear about it: prog.go:8:12: cannot use s (type []string) as type []interface {} in append >From https://golang.org/ref/sp

[go-nuts] interface array and ... operator

2018-10-23 Thread Mayank Jha
why does A() not work while B works here, https://play.golang.org/p/59bpr8TCIge -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegro