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.
On Mon, Feb 13, 2023 at 1:54 PM Privat, Jean <[email protected]> wrote: > This PhEP describes the extension of Pharo numeric literals to accepts > (and ignore) underscore characters (`_` ASCII 95). > > Many languages (including Python https://peps.python.org/pep-0515/ , Java > https://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html > or Ruby) accept some forms of numeric literal that ignore _. > > 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). > > The details of the proposal are in the PR: > https://github.com/pharo-project/pheps/pull/16 > > -- > Jean Privat
