lement it?
Binary literals have been there since way back around the beginning of
D, just like hex literals, decimal literals and the now-dead old-style
octal literals. Back when *everything* in D was a new feature.
If octal literals had been like 0o123 or 0c123 instead of 0123 from the
beginning,
On Thursday, 19 July 2012 at 14:13:06 UTC, Dave X. wrote:
How was the reception of the idea of binary literals as opposed
to octal (I think it's an awesome feature, I think D, OCaml and
Java 7 are the only ones that have it)? How long did it take to
decide to implement it?
If they were introd
"Dave X." wrote in message
news:cokspgduvpyzcbioa...@forum.dlang.org...
> How was the reception of the idea of binary literals as opposed to octal
> (I think it's an awesome feature, I think D, OCaml and Java 7 are the only
> ones that have it)? How long did it take to decide to implement it?
How was the reception of the idea of binary literals as opposed
to octal (I think it's an awesome feature, I think D, OCaml and
Java 7 are the only ones that have it)? How long did it take to
decide to implement it?
have a lot of work. :)
It's a trivial amount of work to add '0o' octal literals to the language,
but it was decided that octals are not used often enough to justify a
language feature.
On 7/18/12 1:39 PM, monarch_dodra wrote:
On Wednesday, 18 July 2012 at 17:37:02 UTC, Andrei Alexandrescu wrote:
On 7/18/12 10:29 AM, monarch_dodra wrote:
I see no reason not to add it
This is never a good argument for adding things to a language.
Andrei
Taken out of context, no it isn't. "
On Wednesday, 18 July 2012 at 17:37:02 UTC, Andrei Alexandrescu
wrote:
On 7/18/12 10:29 AM, monarch_dodra wrote:
I see no reason not to add it
This is never a good argument for adding things to a language.
Andrei
Taken out of context, no it isn't. "It sounds like a good idea",
is a (relati
On 7/18/12 10:29 AM, monarch_dodra wrote:
I see no reason not to add it
This is never a good argument for adding things to a language.
Andrei
Scala as well.
I like using octal numbers, and I've always been interested in
D's octal literals. I'm glad to see that the traditional syntax
of C's octal literals is being replaced by a more readable one.
However, I can't help but think that the template solution
On Wed, Jul 18, 2012 at 05:06:21PM +0200, Simen Kjaeraas wrote:
> On Wed, 18 Jul 2012 16:45:58 +0200, Dave X. wrote:
>
> >Not that this really matters, but out of curiosity, how does this
> >template work?
>
> It converts the passed number to a string, then works on a digit at a
> time. Basicall
On Wed, 18 Jul 2012 16:45:58 +0200, Dave X. wrote:
Not that this really matters, but out of curiosity, how does this
template work?
It converts the passed number to a string, then works on a digit at a
time. Basically:
foreach ( digit; number ) {
if ( digit >= '0' && digit <= '9' )
siastically watching D for a while now (I program primarily
> in Java and C). I have some functional programming experience in Haskell and
> Scala as well.
>
> I like using octal numbers, and I've always been interested in D's octal
> literals. I'm glad to see that the
"Dave X." , dans le message (digitalmars.D:172680), a écrit :
> Not that this really matters, but out of curiosity, how does this
> template work?
By looking at the sources, if the template argument is a string, the
program just compute the octal value as a human would do, that is it
makes the
Java and C). I have some
functional programming experience in Haskell and Scala as well.
I wish D had been as far along as it is now back when I was in
college!
I like using octal numbers, and I've always been interested in
D's octal literals. I'm glad to see that the tr
g experience in Haskell and Scala as well.
>
I wish D had been as far along as it is now back when I was in college!
> I like using octal numbers, and I've always been interested in
> D's octal literals. I'm glad to see that the traditional syntax
> of C's octal li
;ve always been interested in
D's octal literals. I'm glad to see that the traditional syntax
of C's octal literals is being replaced by a more readable one.
However, I can't help but think that the template solution
("octal!nnn") is a little too roundabout; is there a
Rainer Deyke wrote:
On 3/25/2010 23:40, Walter Bright wrote:
Rainer Deyke wrote:
I don't mind octal literals, but '0177' is a horrible syntax. *Every*
*single* *time* that I used that syntax in C or C++, I really meant to
use a decimal.
I'm curious what tempted you to us
On 3/25/2010 23:40, Walter Bright wrote:
> Rainer Deyke wrote:
>> I don't mind octal literals, but '0177' is a horrible syntax. *Every*
>> *single* *time* that I used that syntax in C or C++, I really meant to
>> use a decimal.
>
> I'm curious w
Rainer Deyke wrote:
I don't mind octal literals, but '0177' is a horrible syntax. *Every*
*single* *time* that I used that syntax in C or C++, I really meant to
use a decimal.
I'm curious what tempted you to use a leading 0 in the first place.
support them.
I don't mind octal literals, but '0177' is a horrible syntax. *Every*
*single* *time* that I used that syntax in C or C++, I really meant to
use a decimal.
--
Rainer Deyke - rain...@eldwood.com
e \0 embedded in a string. But
in both D and C# you can. So the "\" case isn't really a problem for
C. It's far more likely in D that someone would write:
"1st\02nd\03rd\04th\0";
and expect it to work.
I doubt there is much extant C code which uses octal. Auto
BCS wrote:
We have plans to release the translator "at some point".
That'll be cool!
Hello Walter,
BCS wrote:
Reply to Walter,
It is a good point, but I don't see people translating C# to D. But
I do see translating C to D (I do it myself!).
I am working with a ~11KLOC c# code base and a tool to automatically
translate it to D
Color me wrong, then!
Not to far off, you
BCS wrote:
Reply to Walter,
It is a good point, but I don't see people translating C# to D. But I
do see translating C to D (I do it myself!).
I am working with a ~11KLOC c# code base and a tool to automatically
translate it to D
Color me wrong, then!
Reply to Walter,
It is a good point, but I don't see people translating C# to D. But I
do see translating C to D (I do it myself!).
I am working with a ~11KLOC c# code base and a tool to automatically translate
it to D
"I had a problem, I decided to solve it with reg-ex, not I have 200 pro
ed
translations of octal literals can be done accurately, and you're even
supplying the 'htod' converter!
htod is not intended for creating implementation source code. It's just
for headers. I expect most C translations will be done by hand.
Note that C# doesn't have
Reply to don,
I think the argument for octal is very, very weak.
OTOH even if I grant that, I don't see much reason for dropping them.
Walter Bright wrote:
Stewart Gordon wrote:
Walter Bright wrote:
The octal literals are done the way C does them. The reason they are
there are for when translating C code to D code, obscure bugs are not
introduced.
How would making them illegal not achieve this aim?
The only point to
Walter Bright wrote:
Christopher Wright wrote:
Can we just remove this?
The octal literals are done the way C does them. The reason they are
there are for when translating C code to D code, obscure bugs are not
introduced.
Okay, that makes sense. Removing it would be an option; \0 would
Stewart Gordon wrote:
Walter Bright wrote:
The octal literals are done the way C does them. The reason they are
there are for when translating C code to D code, obscure bugs are not
introduced.
How would making them illegal not achieve this aim?
The only point to making them illegal would
Hello Stewart,
Walter Bright wrote:
The octal literals are done the way C does them. The reason they are
there are for when translating C code to D code, obscure bugs are not
introduced.
How would making them illegal not achieve this aim?
Stewart.
Unless you also drop \0 then any octal
Walter Bright wrote:
The octal literals are done the way C does them. The reason they are
there are for when translating C code to D code, obscure bugs are not
introduced.
How would making them illegal not achieve this aim?
Stewart.
Christopher Wright wrote:
Can we just remove this?
The octal literals are done the way C does them. The reason they are
there are for when translating C code to D code, obscure bugs are not
introduced.
Christopher Wright wrote:
Octal literals aren't necessary with hex literals, but they might be
convenient. However, making them variable width seems like it opens up
the possibility for obscure bugs. I would not recommend that anyone use
octal literals, and I don't think they'
Sean Kelly wrote:
All the escaped literals are going away, I believe.
I think all that's happening there is the removal of escaped characters
not enclosed in quotes.
Stewart.
There are three forms of hex literals:
> \x: 2 digits
> \u: 4 digits
> \U: 8 digits
>
> There is one form of octal literal:
> \: 1 to 3 digits
>
> Why? With hex literals, each option is a fixed width. That is sensible.
>
> Octal literals aren't necessary with hex
gits
\U: 8 digits
There is one form of octal literal:
\: 1 to 3 digits
Why? With hex literals, each option is a fixed width. That is sensible.
Octal literals aren't necessary with hex literals, but they might be
convenient. However, making them variable width seems like it opens up
the
ne form of octal literal:
\: 1 to 3 digits
Why? With hex literals, each option is a fixed width. That is sensible.
Octal literals aren't necessary with hex literals, but they might be
convenient. However, making them variable width seems like it opens up
the possibility for obscure bu
38 matches
Mail list logo