-
Notifications
You must be signed in to change notification settings - Fork 20
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
Float32 literals without the numeric dot #750
Comments
Having to put the dot is rather annoying. Even with this a float still would have to have a dot which is another inconsistency. |
I proposed |
Generally I'd be supportive of this, since the decimal case is already supported. |
If this is approved I can take care of the implementation. It's rather simple to implement, just a change in the parse&lexer I guess. |
Yes, this is reasonable. Marking as approved |
@gdziadkiewicz, nice to see you working on this. Are you also doing the RFC? I know it's a small language change, but I believe we should always have an RFC in place to cover language feature changes. I can make one, I'm just holding off in case we would both be working on it ;). |
If you are willing to create the RFC then please do so - I didn't start working on it yet :) |
@Happypig375, could you give this suggestion a more meaningful title please? Something like 'Allow literal integers to be float when they have a suffix "f" '? (I only see '750f' now, which seems to be the number of the issue) @gdziadkiewicz, I'll give it a try :) |
@gdziadkiewicz, I totally forgot, thanks for doing the work! 💯 For ease of cross reference: RFC: https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1080-float32-without-dot.md |
closing as this has been completed, see the RFC |
@dsyme, yes it is, but there's small gotcha though, I reported it here: dotnet/fsharp#9338 (though I think it's too minor to warrant a fix before F# 5). |
Float32 literals without the numeric dot
I propose we allow float32 literals without the numeric dot.
The existing way of approaching this problem in F# is having that extra dot when typing float32 literals with that extra, ugly dot. Consider the beautiful decimal literals:
Pros and Cons
The advantages of making this adjustment to F# are consistency between literals:
750.
is float,750m
is decimal, and750f
is float32.The disadvantage of making this adjustment to F# is implementation complexity.
Extra information
Estimated cost (XS, S, M, L, XL, XXL): XS
Related suggestions: dotnet/fsharp#6992
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
The text was updated successfully, but these errors were encountered: