Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Underscores in numeric literals after prefix and before suffix #718
Underscores in numeric literals after prefix and before suffix
I propose we allow underscores in numeric literals after the base prefix and before the type suffix.
Currently, leading/trailing underscores in numeric literals are not allowed after the prefix or before the suffix. This lessens readability because the leading and trailing groups blend into the additional characters and lose their visual "shape".
Is there a rationale for disallowing these underscores? According to RFC FS-0005, the rules seem to be modeled after a pre-existing ruleset from Java. There don't seem to be arguments for or against this specific restriction so it's not clear if it was actively favored or if it just came along for the ride. (Thus I don't believe this necessarily counts as "already been decided" per the affidavit below.)
Also note that some other languages have chosen to be less restrictive:
Pros and Cons
The advantages of making this adjustment to F# are: better readability
The disadvantages of making this adjustment to F# are: none that I know of
Estimated cost (XS, S, M, L, XL, XXL): S
Related suggestions: F# RFC FS-0005 - Underscore Literals
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply: