July 22, 2012 [Issue 6277] Disallow short floating point literals | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=6277 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@digitalmars.com --- Comment #10 from Walter Bright <bugzilla@digitalmars.com> 2012-07-22 12:11:46 PDT --- While I appreciate the rationale here, we need to stop breaking existing code. This is highly annoying and disruptive to existing projects, and I think it's implicated in a lot of abandoned D projects. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 22, 2012 [Issue 6277] Disallow short floating point literals | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=6277 --- Comment #11 from bearophile_hugs@eml.cc 2012-07-22 12:44:24 PDT --- (In reply to comment #10) > While I appreciate the rationale here, we need to stop breaking existing code. This is highly annoying and disruptive to existing projects, and I think it's implicated in a lot of abandoned D projects. You have introduced UCFS in D, this calls for adaptations in other parts of the language. You can't just introduce UCFS and hope nothing else in D will change. The features of a well designed language must be well adapted to each other. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 22, 2012 [Issue 6277] Disallow short floating point literals | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=6277 --- Comment #12 from Jonathan M Davis <jmdavisProg@gmx.com> 2012-07-22 14:36:54 PDT --- > While I appreciate the rationale here, we need to stop breaking existing code. This is highly annoying and disruptive to existing projects, and I think it's implicated in a lot of abandoned D projects. To be fair, adding UFCS broke code using floating point literals, since 1.f became illegal. My changes would just break anyone who did 1. without a trailing 0, which I would expect to be fairly rare. It's incredibly bizarre IMHO that it was ever allowed (though C has done plenty of other bizarre things). However, it's definitely true that it would have been better to make these changes at the same time that UFCS was introduced so that all of the floating point literal breakage occured at once. So, ideally 1. would definitely be disallowed, and I would expect the impact of a such a change to be minimal, since it's such an unnatural thing to do. I expect that it's been used primarily in lieu of tagging f on the end to make an integer literal into a floating point literal. On the other hand, I'm not sure that I care all that much. It's stupid to allow 1., but I'm never going to use it in my code, and most other people aren't either, so it doesn't really affect me all that much. I'd be much more interested in fighting it if we were talking about introducing the feature rather than it being a legacy from C which we didn't clean up and have had for quite some time. I did find it interesting though that it's actually _easier_ for the lexer to allow trailing decimal points than to disallow them. My first reaction would have been that it would have been harder (due to .. and ...), and a recent discussion on the newsgroup about this shows that several others thought the same. But at least with dmd's implementation (and std.conv.to's implementation as well actually), it's easier to just let there be a trailing decimal point rather than requiring a 0. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 22, 2012 [Issue 6277] Disallow short floating point literals | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=6277 --- Comment #13 from Walter Bright <bugzilla@digitalmars.com> 2012-07-22 15:05:44 PDT --- (In reply to comment #12) > To be fair, adding UFCS broke code using floating point literals, since 1.f became illegal. I agree that we do break things now and then as a tradeoff for something else very nice that we want. I don't agree with the rationale that if we broke something here, that means it's fair to break it there, and heck, open season on breaking things. Each breaking change must be considered on its own merits - the advantage accrued vs all the annoyance, irritation, and risk of dead D projects it engenders. Please recall all the posted complaints about D being "unstable". I don't see this change as meeting that bar. After all, it's been around in C forever without making anyone's list I've seen on "things I hate about C". -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 22, 2012 [Issue 6277] Disallow short floating point literals | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=6277 --- Comment #14 from Jonathan M Davis <jmdavisProg@gmx.com> 2012-07-22 15:15:46 PDT --- I think that the irritation caused by this should would be minimal (well disallowing 1. anyway - .1 would get _far_ more complaints), and I'd _like_ to see this change made, but if I'm going to fight over a breaking change, I'd prefer to do so over something that I care about a lot more. > I don't see this change as meeting that bar. After all, it's been around in C forever without making anyone's list I've seen on "things I hate about C". I expect that that's mostly because it doesn't generally affect people that don't use it, and C has _far_ worse problems. If the complaints that D is getting are generally about small stuff like this, then we're doing something very right, even if we're not doing it perfectly. If we're not going to make the change though, I think that we should close this enhancement request. It seems that we almost always leave them open even when the answer is a definitive no, which makes no sense to me. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 22, 2012 [Issue 6277] Disallow short floating point literals | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=6277 --- Comment #15 from bearophile_hugs@eml.cc 2012-07-22 15:45:43 PDT --- (In reply to comment #14) > If we're not going to make the change though, I think that we should close this enhancement request. There are also 8 votes on this enhancement, so there are 9 or 10 persons that like it. So maybe a small discussion in the D newsgroup is needed before closing this down. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 22, 2012 [Issue 6277] Disallow short floating point literals | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=6277 --- Comment #16 from bearophile_hugs@eml.cc 2012-07-22 15:47:23 PDT --- (In reply to comment #13) > After all, it's been around in C > forever without making anyone's list I've seen on "things I hate about C". C doesn't have UCFS. And it's on my list of the things I don't like about C. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 22, 2012 [Issue 6277] Disallow short floating point literals | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=6277 --- Comment #17 from Walter Bright <bugzilla@digitalmars.com> 2012-07-22 15:50:43 PDT --- >I think that the irritation caused by this should would be minimal Certainly it's easy for the user to fix the code. The *problem*, though, is: "I downloaded this D library and it won't compile! D sux!" "My working D project broke *again*. I'm sick of this. D sux!" -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 22, 2012 [Issue 6277] Disallow short floating point literals | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=6277 --- Comment #18 from bearophile_hugs@eml.cc 2012-07-22 16:04:37 PDT --- (In reply to comment #17) > Certainly it's easy for the user to fix the code. > > The *problem*, though, is: > > "I downloaded this D library and it won't compile! D sux!" > > "My working D project broke *again*. I'm sick of this. D sux!" Beside using -d (deprecated features) another way to face similar problems is to use an idea from Python, a switch like "-future" that activates features that will be introduced in future (so the -property flag gets moved into "-future" and removed). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 23, 2012 [Issue 6277] Disallow short floating point literals | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=6277 Andrei Alexandrescu <andrei@metalanguage.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrei@metalanguage.com --- Comment #19 from Andrei Alexandrescu <andrei@metalanguage.com> 2012-07-22 21:55:49 PDT --- I'm as unexcited as Walter about this. It does make sense but the benefits are too small to account for the random breakages. Sorry. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation