News for hackers. Stuff that matters.
Re:From Java to Go, and Back Again (2016) by ecnahc515 on Saturday June 23, 2018 @04:56PM (#17383403)
Unfortunately, to do anything with the results you have to iterate over them again to convert back into a slice of non-empty interfaces, making this implementation basically useless.
Re:From Java to Go, and Back Again (2016) by daenz on Sunday June 24, 2018 @03:42AM (#17385458)
>basically useless

It is how container types are done in Go.

Re:From Java to Go, and Back Again (2016) by nostalgeek on Sunday June 24, 2018 @07:00AM (#17386016)
> It is how container types are done in Go.

You can't define your own compile type safe container types in Go at first place. You demonstrated nothing with your piece of code, you just wrote some dynamic stuff that doesn't care about types, this isn't a container type, you ignore the type of the element.

Re:From Java to Go, and Back Again (2016) by daenz on Monday June 25, 2018 @10:09AM (#17392525)
>You demonstrated nothing with your piece of code

I've demonstrated how you map a function over a list containing any type. How would you do it? Provide a solution.

Re:From Java to Go, and Back Again (2016) by nostalgeek on Monday June 25, 2018 @11:46AM (#17393296)
> I've demonstrated how you map a function over a list containing any type. How would you do it? Provide a solution.

you've demonstrated you are unable to do it while conserving the type of an element.

You iterate over an array with a range loop which allows the code to stay compile time safe. That's the only thing one can call idiomatic go code here. You threw out compile time safety for nothing trying to prove some point that makes no sense to begin with.