-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Visual Separators in Number Literals #6199
Comments
I looked at a few languages for their lexical syntaxes, and there are broadly two conventions that use
Second, the "Rust convention" (used by Rust, Java, and C#):
(For other bases, Rust allows I don't have much of a preference over whether it should be allowed to have sequences of
|
This PR allows `_` in numeric literals as a separator. For example, `1_000_000`, `0xff_ff` or `0b_10_11_01_00`. Closes leanprover#6199
I made a reference implementation of the RFC at #6204 and I'll leave it to the triage team to decide whether to accept it. |
Proposal
Many languages (Java, Python, Perl, Ruby, Julia, Ada, JavaScript, PHP, D, Elixir, C#, C++, Rust, Haskell etc.) support using some character as a visual separator in number literals, mostly
_
, except C++ which uses'
. This suggestion is for this behavior in Lean.Community Feedback
Zulip discussion
Impact
Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: