Interesting - &[]int{5}[0] works, but &[...]int{5}[0] doesn't, and [...]int{5}[:] is also illegal (slice of unaddressable value). I guess I always thought of []T{x,y,z} as sugar for [...]T{x,y,z}[:] but it's more like func()[]T{a := [...]T{x,y,z}; return a[:]}()
I agree these are horrible. I just enjoy exploring the dark corners. On Sat, Oct 22, 2016 at 11:07 AM Matt Harden <matt.har...@gmail.com> wrote: > &(&struct{int}{5}).int also works. :-) > > On Sat, Oct 22, 2016 at 9:29 AM Nate Finch <nate.fi...@gmail.com> wrote: > > Which is effectively the same as my proposal, except horrible. > > On Sat, Oct 22, 2016, 12:18 PM Ian Lance Taylor <i...@golang.org> wrote: > > > You can, of course, write > p3 := &(&Int{5}).i > > Ian > > -- 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...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.