Skip to content
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

Deprecate trailing decimal. #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gdamore
Copy link

@gdamore gdamore commented Oct 26, 2022

No description provided.

@mdparker
Copy link
Member

mdparker commented Oct 27, 2022

Thanks for this submission and your other one. I plan to get the review queue moving again as soon as I have a DIP author who's ready to go. If no one else is ready and it comes down to yours as the most recent submissions, I want to give them each at least a couple of weeks in Draft Review before considering them ready. If you'd like some Draft Review feedback on them, please post about them in the forums. Thanks!

@gdamore
Copy link
Author

gdamore commented Oct 27, 2022

Thanks, I did post these on the discord channel already.

@mdparker
Copy link
Member

That's good, too. I saw your post in the Internals forum. That's not going to get a lot of eyes. A lot of regular forum users don't use the forum interface, but prefer the newsgroups or mailing list, and probably aren't subscribed to Internals (it's a fairly quiet forum). I posted in the Announce forum as well.

@gdamore
Copy link
Author

gdamore commented Sep 29, 2023

Ping?

@mdparker
Copy link
Member

mdparker commented Oct 6, 2023

See #234 (comment)

@baryluk
Copy link

baryluk commented Dec 25, 2023

Did you run any large scale (i.e. from github or dub) compilation tests, or just some grep on them to see how many things will break?

Other than, definitively, +1 from me. I never used trailing decimal dot on floats, and always tough it is a bad idea in C. But I know of people who love them and use a lot, because 1. and 0. are shorter.

Also any idea how long deprecation period will be? Considering this is really minor thing, and does not change that much in code, it should be really long.

Another question. How does this affect functions like to!float(string) and atof/atod. It might be worth deprecating support for trailing decimals in them too, but that is going to be super hard to deploy, because that changes semantic, and these functions could be reading data from who knows where. This could break a number of file parsing and network protocol parsing bits. In JSON, trailing decimal dot is not allowed, and many implementations will neither generate, nor accept it. But some might accept it, and now disallowing could have unknown and hard to track consequences. On the other hand, in YAML format, trailing decimal dots ARE allowed.

So, I think DIP should clarify that to!float et. al. and other Phobos functions (other than parser) will not be changed, and why.

Also impact on third-party tools managing source code, like syntax highlighters, reformatters, should be discussed. I think there should be none (unless some reformatter converts 1.0 to 1. for some reason, which could be, but probably unlikely).

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

Successfully merging this pull request may close these issues.

3 participants