Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Example/use case for separators within octal integer literal? #44

Closed
mathiasbynens opened this issue May 4, 2019 · 5 comments
Closed

Comments

@mathiasbynens
Copy link
Member

https://github.com/tc39/proposal-numeric-separator#octal-literal mentions that separators in legacy octal integer literals (e.g. 01234567) are not supported, but it fails to mention that the proposal does support separators in (non-legacy) octal integer literals, e.g. 0o123456, and it doesn’t give an example nor does it motivate the use case.

Can this be clarified + an example be added please? I’m struggling to think of a use case for separators in octal integer literals. Where would it make sense to even put the separators?

@Xyncgas

This comment has been minimized.

@leobalter
Copy link
Member

@mathiasbynens we have a few examples now after #48, but there is not much of a clarification, I admit.

I'd say separators are conventionally available in all non-legacy numeric literal representations, including BigInt and I remember that was an expressed intention. While it goes less specific for why we do support octal integer literals, we basically don't make it a special case to exclude the separators. Does it sound fair enough to you?

@leobalter
Copy link
Member

I added a quick paragraph here 37afbd8

Please reopen this if it's not enough. Feel free to ping me so we can try to improve it.

@mathiasbynens
Copy link
Member Author

If the rationale is “we add new features to all non-legacy numeric literal types” that sounds good to me. It would be good to capture that in the readme.

@leobalter
Copy link
Member

I just noticed I committed the changes in the file before saving it in my editor. Oops.

It's now fixed w/ examples to BigInt literals. Please, let me know if there is anything else I could improve there at this moment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants