Walter Bright wrote:
never encountered a problem with it
Please recall the famous `fori=' vs. `for i=' mistake:
one unintentional changed or added character might change the meening
of the code but compile undetected:
| auto x = +1L;
| auto y = -1L;
| auto z = .1L;
Whereas
| auto z =
On Monday, 7 May 2012 at 12:34:26 UTC, Steven Schveighoffer wrote:
On Sun, 06 May 2012 21:02:28 -0400, bearophile
bearophileh...@lycos.com wrote:
Or maybe you initially have written:
auto r = 1.1L;
And later you want to change the number to 1.0 and you fix it
like this:
auto r = 1L;
Now you
On Mon, 07 May 2012 14:11:34 -0400, Arne a...@linux.nu wrote:
On Monday, 7 May 2012 at 12:34:26 UTC, Steven Schveighoffer wrote:
On Sun, 06 May 2012 21:02:28 -0400, bearophile
bearophileh...@lycos.com wrote:
Or maybe you initially have written:
auto r = 1.1L;
And later you want to change
On 5/7/2012 12:07 PM, Steven Schveighoffer wrote:
However, I think these examples are misleading and do not prove the point. It
shows IMO more that you are better off declaring the type on the left if your
code depends on it always staying the same.
i.e. this does not have that problem:
real r
R suffix for reals
This is small enhancement suggestion :-) (Issue 8049).
The f suffix turns a number literal without . into a float,
while L requires a . in the number literal, otherwise you
have defined a literal of type long:
void main() {
auto x1 = 1f;
static assert
On Sunday, 6 May 2012 at 22:49:13 UTC, bearophile wrote:
R suffix for reals
This is small enhancement suggestion :-) (Issue 8049).
The f suffix turns a number literal without . into a float,
while L requires a . in the number literal, otherwise you
have defined a literal of type long:
void
I didn't know about the decimal-point + L notation for reals. It
does seem... surprising. I don't see a reason why ‘R’
wouldn't be a good choice. I also don't see why someone would
write ‘1.0L’ and expect a long.
On Monday, May 07, 2012 00:49:11 bearophile wrote:
R suffix for reals
This is small enhancement suggestion :-) (Issue 8049).
The f suffix turns a number literal without . into a float,
while L requires a . in the number literal, otherwise you
have defined a literal of type long:
void
Jonathan M Davis:
And what is so onerous about having to do 1.0L instead of 1R?
It's not onerous, the purpose of R is not to save typing .0.
(it would have to be either double or real, and
apparently it's real).
1.0L is always a real in D.
We _could_ add R, but I don't really see what
That's why you shouldn't http://www.quickmeme.com/meme/3p5mcu/
On Monday, 7 May 2012 at 01:02:29 UTC, bearophile wrote:
Jonathan M Davis:
And what is so onerous about having to do 1.0L instead of 1R?
It's not onerous, the purpose of R is not to save typing .0.
(it would have to be
On Monday, May 07, 2012 03:02:28 bearophile wrote:
Jonathan M Davis:
And what is so onerous about having to do 1.0L instead of 1R?
It's not onerous, the purpose of R is not to save typing .0.
(it would have to be either double or real, and
apparently it's real).
1.0L is always a
On Monday, 7 May 2012 at 01:02:29 UTC, bearophile wrote:
Jonathan M Davis:
And what is so onerous about having to do 1.0L instead of 1R?
It's not onerous, the purpose of R is not to save typing
.0. If you write auto x = 1L; thinking about defining a
real, as you define a float with auto x
On 5/6/2012 6:46 PM, Jonathan M Davis wrote:
I'm sorry, but I think that you're making an issue out of nothing. 1L is
clearly a long, not a real, and you're going to get compilation errors very
quickly if you really meant to have a real. Yes, there _are_ cases where you
could have a silent,
On Monday, 7 May 2012 at 02:19:19 UTC, Walter Bright wrote:
I agree. It's as old as C, and I've never encountered a problem
with it. And as Era Scarecrow posted, this leads to suffixes
for every type.
Only if you had to be specific to clarify certain confusion. 95%
or more of the time the
On 5/6/2012 7:33 PM, Era Scarecrow wrote:
Was mostly commenting when I see L, I think 'long' right away, not 'long or
possibly float/double'.
The L comes from C and meant of long double.
On Monday, 7 May 2012 at 03:42:18 UTC, Walter Bright wrote:
On 5/6/2012 7:33 PM, Era Scarecrow wrote:
Was mostly commenting when I see L, I think 'long' right away,
not 'long or
possibly float/double'.
The L comes from C and meant of long double.
Interesting; But still for me (and likely
16 matches
Mail list logo