Thanks for your explaination, I was just curious about the language constraint details.
在 2017年8月21日星期一 UTC+8下午2:16:25,Axel Wagner写道: > > If a constant was addressable, you could do > > const x = 42 > x = 23 > fmt.Println(x) // 23 > > so a constant wouldn't be constant anymore. The minimum Go would need, to > make constants addressable would be some notion of const-pointers (that is, > pointers which don't allow modification of the pointee). > > May I ask why it would be interesting to take the address of a constant? > > On Mon, Aug 21, 2017 at 7:23 AM, chou <lock...@gmail.com <javascript:>> > wrote: > >> I guess that const will be substitute literally at compile time >> for performance improvements. So there is not such variable in >> run time. >> >> Is it right? >> >> -- >> 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...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- 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.