[spec/test/interpreter] Allow underscores in numbers#527
Conversation
|
FYI: Found this as a useful reference for prior art: https://www.python.org/dev/peps/pep-0515/#prior-art. edit: and this https://github.com/tc39/proposal-numeric-separator#prior-art Seems as though most languages allow underscores only between digits (like you've done here). It also seems that most languages allow multiple consecutive underscores (unlike here). I don't think it's a big deal either way, though. |
|
I'd be fine with allowing multiple consecutive underscores. I merely went for the most conservative option. |
|
(edit: ah, nevermind, i see that that has already been pointed out earlier in the thread. sorry, carry on with the good work :)) FWIW, this is a similar discussion in JS land that may help inform your design (e.g. tradeoffs and prior art). |
FWIW, the most conservative option is to allow non consecutive underscores. You can always change that later (we haven't found enough evidence that it adds anything) but not retract otherwise. This is the direction that JS is going to with that regards. |
Based on comments from WebAssembly#1391.
Fix an example code for ref.cast in MVP.md
Allow literals like 1_000, 0xfff_ffff, 3.145_692 etc, as discussed earlier.