Re: Complete floating point literals

2011-07-11 Thread Paul D. Anderson
bearophile Wrote: > This comes from a small sub-thread in D.learn (but I have asked for it the > first time in bug 3837 time ago): > http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=28030 > > I suggest to turn floating point literals like the following i

Re: Complete floating point literals

2011-07-11 Thread Trass3r
.5 3. And require to write them like this: 0.5 3.0 +1 (Daniel Murphy suggests to allow 1.f and 1.L (and maybe .2f and .2L too) but I think this is a special case). -1

Re: Complete floating point literals

2011-07-11 Thread Steven Schveighoffer
On Sun, 10 Jul 2011 13:51:10 -0400, Daniel Murphy wrote: "bearophile" wrote in message news:ivcg7j$ooj$1...@digitalmars.com... Jacob Carlborg reminds that 1.f conflicts with the UFCS, I think the suggestion by Daniel Murphy of the special case is not worth it. If the only reason for remo

Re: Complete floating point literals

2011-07-10 Thread bearophile
Caligo: > It would be really great if we could put all the breaking changes into > one release to minimize disruption. iirc, another breaking change is > the fix to foreach. Walter has not commented on both of them, so this discussion is just theoretical still. DMD 2.054 will introduce several

Re: Complete floating point literals

2011-07-10 Thread Caligo
It would be really great if we could put all the breaking changes into one release to minimize disruption. iirc, another breaking change is the fix to foreach.

Re: Complete floating point literals

2011-07-10 Thread bearophile
Caligo: > while we are at it, let's get rid of this too: > > class _{ } > > why would anyone want to name a class or a variable _ ?? I use _ now and then in debugging as variable name when I don't care for the name itself (but this is not a very good practice otherwise). While in the years "in

Re: Complete floating point literals

2011-07-10 Thread Andrej Mitrovic
On 7/11/11, Caligo wrote: > while we are at it, let's get rid of this too: > > class _{ } > > why would anyone want to name a class or a variable _ ?? > I think his is used in dranges, to make it do stuff like: map!(_1 + _2)(bar); Something like that.. not sure.

Re: Complete floating point literals

2011-07-10 Thread Chris Molozian
Maybe they want to write an API with a "Web 2.0" style ? :-P Chris On 07/11/11 00:49, Caligo wrote: while we are at it, let's get rid of this too: class _{ } why would anyone want to name a class or a variable _ ??

Re: Complete floating point literals

2011-07-10 Thread Caligo
while we are at it, let's get rid of this too: class _{ } why would anyone want to name a class or a variable _ ??

Re: Complete floating point literals

2011-07-10 Thread Timon Gehr
KennyTM~ wrote: > No special case needed. Just complicate the grammar to > > // in terms of regex: [0-9][0-9_]* > > DecimalDigits: >DecimalDigit >DecimalDigit DecimalDigitsOrUnderscores > > DecimalDigitsOrUnderscores: >DecimalDigitOrUnderscore >DecimalDig

Re: Complete floating point literals

2011-07-10 Thread bearophile
Timon Gehr: > This is not a particularly strong argument in this case. Numeric literals > cannot > *start* with an underscore either. For a similar reason. You add some detail > to > the exception to the usage of the underscore, you do not really introduce a > new > one. ;) OK. Bye, bearophil

Re: Complete floating point literals

2011-07-10 Thread KennyTM~
On Jul 11, 11 02:03, bearophile wrote: Daniel Murphy: If the only reason for removing 1.f and 1.L is to aid ufcs It's not the only reason, it's also a special case of the rule that asks for a zero. we should also get rid of leading underscores after the decimal point. eg 1._3 also confli

Re: Complete floating point literals

2011-07-10 Thread Timon Gehr
bearophile wrote: > Daniel Murphy: > >> If the only reason for removing 1.f and 1.L is to aid ufcs > > It's not the only reason, it's also a special case of the rule that asks for > a zero. > > >> we should also get rid of leading underscores after the decimal >> point. eg 1._3 also conflicts wit

Re: Complete floating point literals

2011-07-10 Thread Simen Kjaeraas
On Sun, 10 Jul 2011 19:51:10 +0200, Daniel Murphy wrote: "bearophile" wrote in message news:ivcg7j$ooj$1...@digitalmars.com... Jacob Carlborg reminds that 1.f conflicts with the UFCS, I think the suggestion by Daniel Murphy of the special case is not worth it. If the only reason for remo

Re: Complete floating point literals

2011-07-10 Thread bearophile
Daniel Murphy: > If the only reason for removing 1.f and 1.L is to aid ufcs It's not the only reason, it's also a special case of the rule that asks for a zero. > we should also get rid of leading underscores after the decimal > point. eg 1._3 also conflicts with ufcs. I see (this doesn't lo

Re: Complete floating point literals

2011-07-10 Thread Daniel Murphy
"bearophile" wrote in message news:ivcg7j$ooj$1...@digitalmars.com... > Jacob Carlborg reminds that 1.f conflicts with the UFCS, I think the > suggestion by Daniel Murphy of the special case is not worth it. > If the only reason for removing 1.f and 1.L is to aid ufcs we should also get rid of

Re: Complete floating point literals

2011-07-10 Thread bearophile
So far 8 people beside me have answered with a positive vote (Alex Dovhal, Andrej Mitrovic, Bernard Helyer, Daniel Gibson, Jacob Carlborg, Nick Sabalausky, Simen Kjaeraas, Timon Gehr) and so far no one has voted against it. Currently the enhancement request in Bugzilla has 7 votes (cbkbbejeap,

Re: Complete floating point literals

2011-07-10 Thread Alex_Dovhal
"bearophile" wrote: [...] +1.0 vote. Also, no one writes .5 or 3. on paper to save one char.

Re: Complete floating point literals

2011-07-10 Thread Jacob Carlborg
On 2011-07-09 21:28, Timon Gehr wrote: Nick Sabalausky wrote: "bearophile" wrote in message news:iva982$dm8$1...@digitalmars.com... This comes from a small sub-thread in D.learn (but I have asked for it the first time in bug 3837 time ago): http://www.digitalmars.com/webnews/newsgroups.php?a

Re: Complete floating point literals

2011-07-10 Thread Jacob Carlborg
On 2011-07-09 21:13, bearophile wrote: This comes from a small sub-thread in D.learn (but I have asked for it the first time in bug 3837 time ago): http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=28030 I suggest to turn floating point literals like the

Re: Complete floating point literals

2011-07-09 Thread Simen Kjaeraas
On Sat, 09 Jul 2011 21:13:06 +0200, bearophile wrote: [Good stuff] Votes += 1.0; -- Simen

Re: Complete floating point literals

2011-07-09 Thread Bernard Helyer
I agree with you, they cause far more pain than they are worth. Axe 'em!

Re: Complete floating point literals

2011-07-09 Thread Andrej Mitrovic
+1, I just had a bug yesterday where I erroneously used .1 instead of 1. . And I introduced that bug while fixing another one, heh.

Re: Complete floating point literals

2011-07-09 Thread Timon Gehr
Nick Sabalausky wrote: > "bearophile" wrote in message > news:iva982$dm8$1...@digitalmars.com... >> This comes from a small sub-thread in D.learn (but I have asked for it the >> first time in bug 3837 time ago): >> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&art

Re: Complete floating point literals

2011-07-09 Thread Daniel Gibson
Am 09.07.2011 21:13, schrieb bearophile: > This comes from a small sub-thread in D.learn (but I have asked for it the > first time in bug 3837 time ago): > http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=28030 > > I suggest to turn floating point literal

Re: Complete floating point literals

2011-07-09 Thread Nick Sabalausky
"bearophile" wrote in message news:iva982$dm8$1...@digitalmars.com... > This comes from a small sub-thread in D.learn (but I have asked for it the > first time in bug 3837 time ago): > http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=28030 > > I suggest

Complete floating point literals

2011-07-09 Thread bearophile
This comes from a small sub-thread in D.learn (but I have asked for it the first time in bug 3837 time ago): http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=28030 I suggest to turn floating point literals like the following into syntax errors (maybe jus