I like it.
I assume that the enhancement will include converting strings to numbers
'10_000' asNumber = 10_000
On Feb 14 2023, at 9:30 am, Guillermo Polito <guillermopolito@gmail.com> wrote:
+1
Seems reasonable to me. I was just wishing for such a thing for exactly the reason you mention (keeping track of zeroes in large integer literals). AFAICT you've done a pretty good job laying out the possible error conditions. I think your option 1 makes sense���the error-prone-ness is the sort of thing that could happen in theory, but I'm not too worried about in practice. Or option 2 is fine, I'm just not familiar enough with the parser to know how much harder it might be to implement.
This PhEP describes the extension of Pharo numeric literals to accepts (and ignore) underscore characters (`_` ASCII 95).
The idea is to permit long literals that are still readable, eg. `1_000_000_000` is easier for a human than `100000000` especially since in the previous literal a zero is missing (I'm a tricky deceitful fellow).
--
Jean Privat