Re: [go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-14 Thread Ian Lance Taylor
On Wed, Sep 14, 2016 at 11:51 AM, 'simon place' via golang-nuts wrote: > what about when you're writing a lib, can't the importing code make use of > constants? No warning about an unused variable or constant would ever apply to an exported name. That would not

[go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-14 Thread 'simon place' via golang-nuts
what about when you're writing a lib, can't the importing code make use of constants? On Monday, 12 September 2016 13:57:15 UTC+1, Markus Zimmermann wrote: > > Hi gophers! > > I am wondering why we have a "declared and not used" compile error for > variables

[go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-14 Thread
A difference: - it isn't possible to derive the address of a named variable from the address of another named variable - it is possible to derive the value of a named const from another named const const ( a = 0 // b-1, c-2 b = 1 // a+1, c-1 c = 2 // a+2, b+1 )

[go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-14 Thread Volker Dobler
Am Mittwoch, 14. September 2016 15:43:14 UTC+2 schrieb Markus Zimmermann: > > On Wednesday, September 14, 2016 at 3:37:10 PM UTC+2, Alan Donovan wrote: >> >> On 14 September 2016 at 09:32, Markus Zimmermann >> wrote: >>> >>> Do you think this might be worth bringing up in

Re: [go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-14 Thread Ian Lance Taylor
On Wed, Sep 14, 2016 at 6:43 AM, Markus Zimmermann wrote: > On Wednesday, September 14, 2016 at 3:37:10 PM UTC+2, Alan Donovan wrote: >> >> On 14 September 2016 at 09:32, Markus Zimmermann wrote: >>> >>> Do you think this might be worth bringing up in

[go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-14 Thread Markus Zimmermann
On Wednesday, September 14, 2016 at 3:37:10 PM UTC+2, Alan Donovan wrote: > > On 14 September 2016 at 09:32, Markus Zimmermann > wrote: >> >> Do you think this might be worth bringing up in golang-dev? >> > > No. We can't make this change to the language without breaking

[go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-14 Thread Markus Zimmermann
On Wednesday, September 14, 2016 at 3:47:29 PM UTC+2, Chris Hines wrote: > > On Monday, September 12, 2016 at 8:57:15 AM UTC-4, Markus Zimmermann wrote: >> >> Hi gophers! >> >> I am wondering why we have a "declared and not used" compile error for >> variables

[go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-14 Thread Chris Hines
On Monday, September 12, 2016 at 8:57:15 AM UTC-4, Markus Zimmermann wrote: > > Hi gophers! > > I am wondering why we have a "declared and not used" compile error for > variables [https://play.golang.org/p/KLzHVO5L7q] but not for constants [ > https://play.golang.org/p/JG9dSa_VKg]? I am sure

[go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-14 Thread 'Alan Donovan' via golang-nuts
On 14 September 2016 at 09:32, Markus Zimmermann wrote: > > Do you think this might be worth bringing up in golang-dev? > No. We can't make this change to the language without breaking existing programs. -- You received this message because you are subscribed to the Google

[go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-14 Thread Markus Zimmermann
On Tuesday, September 13, 2016 at 3:50:12 PM UTC+2, Alan Donovan wrote: > > On 13 September 2016 at 08:22, Markus Zimmermann > wrote: > >> On Monday, September 12, 2016 at 3:41:35 PM UTC+2, adon...@google.com >> wrote: >>> >>> unused constants and types cost nothing at run

[go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-13 Thread 'Alan Donovan' via golang-nuts
On 13 September 2016 at 08:22, Markus Zimmermann wrote: > On Monday, September 12, 2016 at 3:41:35 PM UTC+2, adon...@google.com > wrote: >> >> unused constants and types cost nothing at run time. It's not that >> simple, of course, because constant and type declarations may

[go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-13 Thread Markus Zimmermann
On Monday, September 12, 2016 at 3:21:50 PM UTC+2, Sjon Kosse wrote: > > Hello, > > Const values can be accesed still by reflection in a reasonable manner. > This question has come by quite a few times before on the mailing list, > better explanations should be easy to find. > I do not think

[go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-13 Thread Markus Zimmermann
On Monday, September 12, 2016 at 3:41:35 PM UTC+2, adon...@google.com wrote: > > On Monday, 12 September 2016 08:57:15 UTC-4, Markus Zimmermann wrote: >> >> Hi gophers! >> >> I am wondering why we have a "declared and not used" compile error for >> variables [https://play.golang.org/p/KLzHVO5L7q]