Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Bakul Shah
I should've realized go automatically coerced float constants to ints. Which is worse but never mind :-) > On Jun 22, 2016, at 8:57 AM, Jan Mercl <0xj...@gmail.com> wrote: > > On Wed, Jun 22, 2016 at 5:54 PM Bakul Shah wrote: > > That can be dealt with an output format.

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Jan Mercl
On Wed, Jun 22, 2016 at 5:56 PM Andy Balholm wrote: > The same is true of brace styles :-P. Brace style is a matter of preference. Wrong digit grouping in a given place on Earth is wrong, not less preferred. -- -j -- You received this message because you are

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Jan Mercl
On Wed, Jun 22, 2016 at 5:54 PM Bakul Shah wrote: That can be dealt with an output format. Just as the hex or octal or the "e" input format is lost. > ... in Go there is a slight inconsistency: 1e6 is an int but 1e-6 is a float. The literals 1e6 and 1e-6 are both untyped

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Andy Balholm
The same is true of brace styles :-P. But my point is that by not allowing digit grouping, Go avoids style debates on that issue. The grouping could have been standardized with gofmt, but as it is, it is standardized by the compiler to a format that is universally understood (no grouping).

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Bakul Shah
That can be dealt with an output format. Just as the hex or octal or the "e" input format is lost. With respect to the "e" notation Go seems to be an exception. Perhaps the sole one? Other prog languages I have used treat eas a floating pt. even in Go there is a slight inconsistency: 1e6 is an

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Andy Balholm
Actually, the mention of gofmt brings up the issue of consistent formatting. If underscores in numbers were allowed, gofmt should automatically insert them for all numbers over a given length, and remove them for shorter numbers. Otherwise it would just be another opportunity for inconsistency,

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Michael Jones
Sorry, I sent that too soon. One argument against underscores in numbers and other discardable syntax is the tooling in Go to parse and regenerate go code, as in gofmt. It may be more complicated to keep the “original input format” around and that is a pretty good argument—unless that is

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Michael Jones
> https://github.com/golang/go/issues/42 Michael Jones michael.jo...@gmail.com > On Jun 22, 2016, at 7:29 AM, Roger Pack wrote: > > Could you drop me a link to the discussion by chance? Seems this > feature is actually a reasonably common request :) -- You received

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Roger Pack
Could you drop me a link to the discussion by chance? Seems this feature is actually a reasonably common request :) On Tue, Jun 21, 2016 at 12:47 PM, Michael Jones wrote: > I asked for this a while back ("drop underscore between digits as in Ada") > and the answer was

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Ian Lance Taylor
On Wed, Jun 22, 2016 at 6:50 AM, Manlio Perillo wrote: > On Wed, Jun 22, 2016 at 3:35 PM, Henrik Johansson > wrote: >> Really? > > Yes. > The problem is that many people coming from C like languages may > incorrectly assume that i is a floating

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Henrik Johansson
Really? I find that counting digits in large numbers is harder, for me at least, than expected. The scientific notation is sweet. On Wed, Jun 22, 2016, 14:57 Manlio Perillo wrote: > Il giorno martedì 21 giugno 2016 18:35:13 UTC+2, Caleb Spare ha scritto: >> >> This was

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Manlio Perillo
Il giorno martedì 21 giugno 2016 18:35:13 UTC+2, Caleb Spare ha scritto: > > This was shut down without much discussion at > https://github.com/golang/go/issues/42. > > I agree that it's a nice feature. > > By the way, though, one nice aspect of Go is that because of how > untyped constants

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-21 Thread Michael Jones
I asked for this a while back ("drop underscore between digits as in Ada") and the answer was no. I try to ask just once. This was shut down without much discussion at https://github.com/golang/go/issues/42. I agree that it's a nice feature. By the way, though, one nice aspect of Go is that

[go-nuts] feature request: allow literal digit underscore grouping

2016-06-21 Thread Roger Pack
I found recently when doing some language comparisons In a few other languages (ruby, java, etc.) underscores within numeric literals to make them more readable, ex: 10_000_000.times do ... end go ex: for i := 0; i < 1000; i++ { ... } I find it helps readability, and think it would be