Re: Underscores in numbers for legibility
Lassi Kortela 12 Apr 2019 20:00 UTC
> Same here for CHICKEN, but I'm a bit hesitant to go in and complicate
> the numerical syntax of Scheme. We just got rid of the ridiculous hash
> syntax (which _really_ complicated Scheme numerical syntax)!
I'm sympathetic to that - simplicity is good. I was thinking it would be
best to only allow it between digits, and deny it at the beginning or
end of a token. And perhaps also to disallow more than one consecutive
underscore. So like this:
1_000_000 ; good
1_000_000_ ; bad
_1_000_000 ; bad
_10000000 ; bad
10000000_ ; bad
1__000_000 ; maybe bad
If underscores are allowed at the beginning of a token, then there is
more possibility of conflict -- e.g. in C you can write a function named
'_123'.