Re: dmd 1.046 and 2.031 releases

2009-07-17 Thread bearophile
Steven Schveighoffer: > Does this compile: > > class C {} > > ubyte foo(C n) > { >return true ? 255 : n; > } > > (don't have the latest compiler installed yet, so I couldn't check it > myself) It doesn't compile (DMD v2.031): temp.d(5): Error: incompatible types for ((255) ? (n)): 'int' a

Re: dmd 1.046 and 2.031 releases

2009-07-17 Thread Steven Schveighoffer
On Fri, 17 Jul 2009 09:46:11 -0400, Don wrote: Steven Schveighoffer wrote: On Fri, 17 Jul 2009 08:08:23 -0400, Don wrote: In this case, I think bearophile's right: it's just a problem with range propagation of the ?: operator. I think the compiler should be required to do the semantics a

Re: dmd 1.046 and 2.031 releases

2009-07-17 Thread Don
Steven Schveighoffer wrote: On Fri, 17 Jul 2009 08:08:23 -0400, Don wrote: In this case, I think bearophile's right: it's just a problem with range propagation of the ?: operator. I think the compiler should be required to do the semantics analysis for single expressions. Not more, not less.

Re: dmd 1.046 and 2.031 releases

2009-07-17 Thread Steven Schveighoffer
On Fri, 17 Jul 2009 08:08:23 -0400, Don wrote: In this case, I think bearophile's right: it's just a problem with range propagation of the ?: operator. I think the compiler should be required to do the semantics analysis for single expressions. Not more, not less. Why? What is the benefit

Re: dmd 1.046 and 2.031 releases

2009-07-17 Thread Stewart Gordon
BCS wrote: Reply to bearophile, John C: Did you not read the change log? "Implicit integral conversions that could result in loss of significant bits are no longer allowed." This was the code: ubyte m = (n <= 0 ? 0 : (n >= 255 ? 255 : n)); That last n is guaranteed to fit inside an ubyte I

Re: dmd 1.046 and 2.031 releases

2009-07-17 Thread Don
BCS wrote: Reply to bearophile, John C: Did you not read the change log? "Implicit integral conversions that could result in loss of significant bits are no longer allowed." This was the code: ubyte m = (n <= 0 ? 0 : (n >= 255 ? 255 : n)); That last n is guaranteed to fit inside an ubyte (ye

Re: dmd 1.046 and 2.031 releases

2009-07-16 Thread Jarrett Billingsley
On Thu, Jul 16, 2009 at 6:43 PM, Jason House wrote: > bearophile Wrote: > >> I'm playing with the new D2 a bit, this comes from some real D1 code: >> >> void main(string[] args) { >>     int n = args.length; >>     ubyte m = (n <= 0 ? 0 : (n >= 255 ? 255 : n)); >> } >> >> At compile-time the compil

Re: dmd 1.046 and 2.031 releases

2009-07-16 Thread Jason House
bearophile Wrote: > I'm playing with the new D2 a bit, this comes from some real D1 code: > > void main(string[] args) { > int n = args.length; > ubyte m = (n <= 0 ? 0 : (n >= 255 ? 255 : n)); > } > > At compile-time the compiler says: > temp.d(3): Error: cannot implicitly convert expres

Re: dmd 1.046 and 2.031 releases

2009-07-16 Thread Charles Hixson
Steven Schveighoffer wrote: On Thu, 16 Jul 2009 08:49:14 -0400, bearophile wrote: I'm playing with the new D2 a bit, this comes from some real D1 code: void main(string[] args) { int n = args.length; ubyte m = (n <= 0 ? 0 : (n >= 255 ? 255 : n)); } At compile-time the compiler says:

Re: dmd 1.046 and 2.031 releases

2009-07-16 Thread BCS
Reply to bearophile, John C: Did you not read the change log? "Implicit integral conversions that could result in loss of significant bits are no longer allowed." This was the code: ubyte m = (n <= 0 ? 0 : (n >= 255 ? 255 : n)); That last n is guaranteed to fit inside an ubyte (yes, I underst

Re: dmd 1.046 and 2.031 releases

2009-07-16 Thread Steven Schveighoffer
On Thu, 16 Jul 2009 08:49:14 -0400, bearophile wrote: I'm playing with the new D2 a bit, this comes from some real D1 code: void main(string[] args) { int n = args.length; ubyte m = (n <= 0 ? 0 : (n >= 255 ? 255 : n)); } At compile-time the compiler says: temp.d(3): Error: cannot im

Re: dmd 1.046 and 2.031 releases

2009-07-16 Thread bearophile
John C: > Did you not read the change log? > "Implicit integral conversions that could result in loss of significant bits > are no longer allowed." This was the code: ubyte m = (n <= 0 ? 0 : (n >= 255 ? 255 : n)); That last n is guaranteed to fit inside an ubyte (yes, I understand the compiler

Re: dmd 1.046 and 2.031 releases

2009-07-16 Thread John C
bearophile Wrote: > I'm playing with the new D2 a bit, this comes from some real D1 code: > > void main(string[] args) { > int n = args.length; > ubyte m = (n <= 0 ? 0 : (n >= 255 ? 255 : n)); > } > > At compile-time the compiler says: > temp.d(3): Error: cannot implicitly convert expres

Re: dmd 1.046 and 2.031 releases

2009-07-16 Thread bearophile
I'm playing with the new D2 a bit, this comes from some real D1 code: void main(string[] args) { int n = args.length; ubyte m = (n <= 0 ? 0 : (n >= 255 ? 255 : n)); } At compile-time the compiler says: temp.d(3): Error: cannot implicitly convert expression (n <= 0 ? 0 : n >= 255 ? 255 :

Re: dmd 1.046 and 2.031 releases

2009-07-13 Thread Max Samukha
On Sun, 05 Jul 2009 22:05:10 -0700, Walter Bright wrote: >Something for everyone here. > > >http://www.digitalmars.com/d/1.0/changelog.html >http://ftp.digitalmars.com/dmd.1.046.zip > > >http://www.digitalmars.com/d/2.0/changelog.html >http://ftp.digitalmars.com/dmd.2.031.zip Nice release. Thank

Re: dmd 1.046 and 2.031 releases

2009-07-09 Thread Don
Leandro Lucarella wrote: Walter Bright, el 5 de julio a las 22:05 me escribiste: Something for everyone here. http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.046.zip http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.031.zip I

Re: dmd 1.046 and 2.031 releases

2009-07-08 Thread Charles Hixson
Andrei Alexandrescu wrote: Robert Jacques wrote: On Tue, 07 Jul 2009 03:33:24 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: That's really cool. But I don't think that's actually happening (Or are these the bugs you're talking about?): byte x,y; short z; z = x+y; // E

Re: dmd 1.046 and 2.031 releases

2009-07-08 Thread Charles Hixson
Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Derek Parnell wrote: It seems that D would benefit from having a standard syntax form

Re: dmd 1.046 and 2.031 releases

2009-07-08 Thread Charles Hixson
Walter Bright wrote: grauzone wrote: I oriented this on the syntax of array slices. Which work that way. Not inconsistent at all. It's also consistent with foreach(_; x..y). It would look consistent, but it would behave very differently. x..y for foreach and slices is exclusive of the y, whil

Re: dmd 1.046 and 2.031 releases

2009-07-08 Thread Ary Borenszweig
Andrei Alexandrescu wrote: Walter Bright wrote: Andrei Alexandrescu wrote: P.S. With the help of a dictionary I think I figured most of this joke: MP: Cómo está, estimado Bellini? B: Muy bien, Mario, astrologando. MP: Qué tengo? B: Un balcón-terraza. MP: No, en mi mano, B

Re: dmd 1.046 and 2.031 releases

2009-07-08 Thread Andrei Alexandrescu
Walter Bright wrote: Andrei Alexandrescu wrote: P.S. With the help of a dictionary I think I figured most of this joke: MP: Cómo está, estimado Bellini? B: Muy bien, Mario, astrologando. MP: Qué tengo? B: Un balcón-terraza. MP: No, en mi mano, Bellini... B: Un secarrop

Re: dmd 1.046 and 2.031 releases

2009-07-08 Thread Walter Bright
Andrei Alexandrescu wrote: P.S. With the help of a dictionary I think I figured most of this joke: MP: Cómo está, estimado Bellini? B: Muy bien, Mario, astrologando. MP: Qué tengo? B: Un balcón-terraza. MP: No, en mi mano, Bellini... B: Un secarropas! MP: No, escuche bi

Re: dmd 1.046 and 2.031 releases

2009-07-08 Thread Walter Bright
Leandro Lucarella wrote: I incidentally went through all the D2 bug reports that had being fixed in this release and I was really surprised about how much of them had patches by Don (the vast majority!). Don's an awesome contributor. I and the rest of the D community are very much indebted to

[OT] Magazine For Fai [was: dmd 1.046 and 2.031 releases]

2009-07-08 Thread Leandro Lucarella
Andrei Alexandrescu, el 8 de julio a las 11:46 me escribiste: I'm sorry about the spanish taglines, they are selected randomly =) And most (in spanish) are pretty local (argentine) jokes. > P.S. With the help of a dictionary I think I figured most of this joke: > > MP: Cómo está, estimado Bell

Re: dmd 1.046 and 2.031 releases

2009-07-08 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Walter Bright, el 5 de julio a las 22:05 me escribiste: Something for everyone here. http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.046.zip http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.031.zip I

Re: dmd 1.046 and 2.031 releases

2009-07-08 Thread Leandro Lucarella
Walter Bright, el 5 de julio a las 22:05 me escribiste: > Something for everyone here. > > > http://www.digitalmars.com/d/1.0/changelog.html > http://ftp.digitalmars.com/dmd.1.046.zip > > > http://www.digitalmars.com/d/2.0/changelog.html > http://ftp.digitalmars.com/dmd.2.031.zip I incidental

Re: dmd 1.046 and 2.031 releases

2009-07-08 Thread Leandro Lucarella
Jesse Phillips, el 8 de julio a las 01:27 me escribiste: > On Tue, 07 Jul 2009 18:43:41 -0300, Leandro Lucarella wrote: > > > > > (BTW, nice job with the Wiki for whoever did it, I don't remember who > > was putting a lot of work on improving the Wiki, but it's really much > > better organized n

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Nick Sabalausky
"Lionello Lunesu" wrote in message news:h30vss$pm...@digitalmars.com... > > Walter, since the lib/include folders were split according to OS, the dmd2 > zip consistently has an extensionless "lib" file in the dmd2 folder. It's also in D1.

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Robert Jacques
On Wed, 08 Jul 2009 00:08:13 -0400, Brad Roberts wrote: Walter Bright wrote: Robert Jacques wrote: On Tue, 07 Jul 2009 23:01:58 -0400, Walter Bright wrote: Robert Jacques wrote: (Caveat: most 32-bit compilers probably defaulted integer to int, though 64-bit compilers are probably default

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Brad Roberts
Walter Bright wrote: > Robert Jacques wrote: >> On Tue, 07 Jul 2009 23:01:58 -0400, Walter Bright >> wrote: >>> Robert Jacques wrote: (Caveat: most 32-bit compilers probably defaulted integer to int, though 64-bit compilers are probably defaulting integer to long.) >>> >>> All 32 bit C c

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Walter Bright
Robert Jacques wrote: On Tue, 07 Jul 2009 23:01:58 -0400, Walter Bright wrote: Robert Jacques wrote: (Caveat: most 32-bit compilers probably defaulted integer to int, though 64-bit compilers are probably defaulting integer to long.) All 32 bit C compilers defaulted int to 32 bits. 64 bit C c

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Robert Jacques
On Tue, 07 Jul 2009 23:01:58 -0400, Walter Bright wrote: Robert Jacques wrote: (Caveat: most 32-bit compilers probably defaulted integer to int, though 64-bit compilers are probably defaulting integer to long.) All 32 bit C compilers defaulted int to 32 bits. 64 bit C compilers are settin

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Walter Bright
Thanks.

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Walter Bright
Robert Jacques wrote: So by the spec (and please correct me if I'm reading this wrong) g = e + f => g = cast(long)( cast(integer)e + cast(integer)f ); where integer is unbounded in bits (and therefore has no overflow) therefore g = e + f; => d = cast(long) e + cast(long) f; is more in keepin

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Jesse Phillips
On Tue, 07 Jul 2009 11:05:31 -0400, bearophile wrote: > KennyTM~ Wrote: >> Maybe http://msdn.microsoft.com/en-us/vcsharp/aa336815.aspx . > > That compromise design looks good to be adopted by D too :-) > > Bye, > bearophile For which we have, case 1, 2, 3: writeln("I believe");

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Lionello Lunesu
"Walter Bright" wrote in message news:h2s0me$30f...@digitalmars.com... Something for everyone here. http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.046.zip http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.031.zip Great rele

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Robert Jacques
On Tue, 07 Jul 2009 21:05:45 -0400, Walter Bright wrote: Andrei Alexandrescu wrote: Robert Jacques wrote: long g; g = e + f; => d = cast(long) e + cast(long) f; Works today. Wrong. I just tested this and what happens today is: g = cast(long)(e+f); And this is (I think) correct behavior

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Derek Parnell
On Tue, 07 Jul 2009 18:26:36 -0700, Walter Bright wrote: > All the messages from the dawn of time are online and available at > http://www.digitalmars.com/d/archives/digitalmars/D/ and are searchable > from the search box in the upper left. Okaaayy ... I see that this (checking for integer ove

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Robert Jacques wrote: On Tue, 07 Jul 2009 21:21:47 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: On Tue, 07 Jul 2009 20:48:50 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: long g; g = e + f; => d = cast(long) e + cast(long) f; Works today. Wrong. I just tested t

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Robert Jacques
On Tue, 07 Jul 2009 21:21:47 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: On Tue, 07 Jul 2009 20:48:50 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: long g; g = e + f; => d = cast(long) e + cast(long) f; Works today. Wrong. I just tested this and what happens

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Walter Bright
Andrei Alexandrescu wrote: You can implement that as a library. In fact I wanted to do it for Phobos for a long time. I've discussed it in this group too (to an unusual consensus), but I forgot the thread's title and stupid Thunderbird "download 500 headers at a time forever even long after hav

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Jesse Phillips
On Tue, 07 Jul 2009 18:43:41 -0300, Leandro Lucarella wrote: > > (BTW, nice job with the Wiki for whoever did it, I don't remember who > was putting a lot of work on improving the Wiki, but it's really much > better organized now) Hi, thanks. > I think we can add a DIP (D Improvement Proposal

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Derek Parnell
On Tue, 07 Jul 2009 20:13:40 -0500, Andrei Alexandrescu wrote: > Derek Parnell wrote: >> Here is where I propose having a signal to the compiler about which >> specific variables I'm worried about, and if I code an assignment to one of >> these that can potentially overflow, then the compiler must

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Robert Jacques wrote: On Tue, 07 Jul 2009 20:48:50 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: long g; g = e + f; => d = cast(long) e + cast(long) f; Works today. Wrong. I just tested this and what happens today is: g = cast(long)(e+f); And this is (I think) correct behavior

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Robert Jacques
On Tue, 07 Jul 2009 20:48:50 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: long g; g = e + f; => d = cast(long) e + cast(long) f; Works today. Wrong. I just tested this and what happens today is: g = cast(long)(e+f); And this is (I think) correct behavior according to the new

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Derek Parnell wrote: Here is where I propose having a signal to the compiler about which specific variables I'm worried about, and if I code an assignment to one of these that can potentially overflow, then the compiler must issue a message. You can implement that as a library. In fact I wante

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Leandro Lucarella
Andrei Alexandrescu, el 7 de julio a las 16:54 me escribiste: > Leandro Lucarella wrote: > >Andrei Alexandrescu, el 7 de julio a las 15:12 me escribiste: > >>Leandro Lucarella wrote: > >>>Andrei Alexandrescu, el 7 de julio a las 10:56 me escribiste: > Leandro Lucarella wrote: > >This see

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Walter Bright
Andrei Alexandrescu wrote: Robert Jacques wrote: long g; g = e + f; => d = cast(long) e + cast(long) f; Works today. Wrong. I just tested this and what happens today is: g = cast(long)(e+f); And this is (I think) correct behavior according to the new rules and not a bug. In the new rules i

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Derek Parnell
On Tue, 07 Jul 2009 19:39:55 -0500, Andrei Alexandrescu wrote: > Nick Sabalausky wrote: >> "bearophile" wrote in message >> news:h3093m$2mu...@digitalmars.com... >>> Before adding a feature X let's discuss them, ... If not enough people >>> like a solution then let's not add it. >> >> Somethin

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Robert Jacques wrote: long g; g = e + f; => d = cast(long) e + cast(long) f; Works today. Wrong. I just tested this and what happens today is: g = cast(long)(e+f); And this is (I think) correct behavior according to the new rules and not a bug. In the new rules int is special, in this sugge

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Nick Sabalausky wrote: "bearophile" wrote in message news:h3093m$2mu...@digitalmars.com... Before adding a feature X let's discuss them, ... If not enough people like a solution then let's not add it. Something like that was attempted once before. Andrei didn't like what we had to say, got h

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Derek Parnell
On Tue, 07 Jul 2009 18:10:24 -0400, Robert Jacques wrote: > On Tue, 07 Jul 2009 18:05:26 -0400, Derek Parnell wrote: > >> On Tue, 07 Jul 2009 14:05:33 -0400, Robert Jacques wrote: >> >> >>> Well, how often does everyone else use bytes? >> >> Cryptography, in my case. >> > > Cool. If you don't m

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:h30907$2lk...@digitalmars.com... Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:h2vprn$1t7...@digitalmars.com... This is a different beast. We simply couldn't devise a satisfactory scheme within the constr

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:h30907$2lk...@digitalmars.com... > Nick Sabalausky wrote: >> "Andrei Alexandrescu" wrote in message >> news:h2vprn$1t7...@digitalmars.com... >>> This is a different beast. We simply couldn't devise a satisfactory >>> scheme within the constraints we

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Nick Sabalausky
"bearophile" wrote in message news:h3093m$2mu...@digitalmars.com... > Before adding a feature X let's discuss them, ... If not enough people > like a solution then let's not add it. Something like that was attempted once before. Andrei didn't like what we had to say, got huffy, and withdrew fr

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Walter Bright
Robert Jacques wrote: The new rules are definitely an improvement over C, but they make byte/ubyte/short/ushort second class citizens, because practically every assignment requires a cast: byte a,b,c; c = cast(byte) a + b; They've always been second class citizens, as their types keep getting

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Walter Bright
Andrei Alexandrescu wrote: Nick Sabalausky wrote: I assume then that you've looked at something lke C#'s checked/unchecked scheme and someone's (I forget who) idea of expanding that to something like unchecked(overflow, sign)? What was wrong with those sorts of things? An unchecked-based ap

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Derek Parnell
On Tue, 07 Jul 2009 21:20:42 +0200, "Jérôme M. Berger" wrote: > Andrei Alexandrescu wrote: >> Jérôme M. Berger wrote: >>> Andrei Alexandrescu wrote: Jérôme M. Berger wrote: > Andrei Alexandrescu wrote: >> Derek Parnell wrote: >>> It seems that D would benefit from having a standar

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Derek Parnell
On Tue, 07 Jul 2009 13:16:14 -0500, Andrei Alexandrescu wrote: > Safe D is concerned with memory safety only. That's a pity. Maybe it should be renamed to Partially-Safe D, or Safe-ish D, Memory-Safe D, or ... well you get the point. Could be misleading for the great unwashed. -- Derek Parnel

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Derek Parnell
On Tue, 07 Jul 2009 14:16:12 -0500, Andrei Alexandrescu wrote: > Bill Baxter wrote: >> 2009/7/7 Andrei Alexandrescu : >>> I think Walter's message really rendered the whole discussion moot. Post of >>> the year: >>> >>> = >>> I like: >>> >>> a .. b+1 >>> >>> to mean inclu

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Robert Jacques
On Tue, 07 Jul 2009 18:05:26 -0400, Derek Parnell wrote: On Tue, 07 Jul 2009 14:05:33 -0400, Robert Jacques wrote: Well, how often does everyone else use bytes? Cryptography, in my case. Cool. If you don't mind, what's you're take new rules? (As different use cases and points of view

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Derek Parnell
On Tue, 07 Jul 2009 20:13:45 +0200, "Jérôme M. Berger" wrote: > Andrei Alexandrescu wrote: >> Derek Parnell wrote: >>> It seems that D would benefit from having a standard syntax format for >>> expressing various range sets; >>> a. Include begin Include end, i.e. [] >>> b. Include begin Exclude

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Derek Parnell
On Tue, 07 Jul 2009 14:05:33 -0400, Robert Jacques wrote: > Well, how often does everyone else use bytes? Cryptography, in my case. -- Derek Parnell Melbourne, Australia skype: derek.j.parnell

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Andrei Alexandrescu, el 7 de julio a las 15:12 me escribiste: Leandro Lucarella wrote: Andrei Alexandrescu, el 7 de julio a las 10:56 me escribiste: Leandro Lucarella wrote: This seems nice. I think it would be nice if this kind of things are commented in the NG bef

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Leandro Lucarella
Andrei Alexandrescu, el 7 de julio a las 15:12 me escribiste: > Leandro Lucarella wrote: > >Andrei Alexandrescu, el 7 de julio a las 10:56 me escribiste: > >>Leandro Lucarella wrote: > >>>This seems nice. I think it would be nice if this kind of things are > >>>commented in the NG before a compil

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Robert Jacques
On Tue, 07 Jul 2009 14:16:14 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: On Tue, 07 Jul 2009 11:36:26 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: Andrei, I have a short vector template (think vec!(byte,3), etc) where I've had to wrap the majority lines of code i

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Jérôme M. Berger
Walter Bright wrote: Andrei Alexandrescu wrote: Bill Baxter wrote: 2009/7/7 Andrei Alexandrescu : I think Walter's message really rendered the whole discussion moot. Post of the year: = I like: a .. b+1 to mean inclusive range. = Not ever

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Jérôme M. Berger wrote: - A floating point range should allow you to specify the iteration step, or else it should allow you to iterate through all numbers that can be represented with the corresponding precision; We don't have that, so you

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Jérôme M. Berger
Andrei Alexandrescu wrote: Jérôme M. Berger wrote: - A floating point range should allow you to specify the iteration step, or else it should allow you to iterate through all numbers that can be represented with the corresponding precision; We don't have that, so you'd need to use a straigh

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Andrei Alexandrescu, el 7 de julio a las 10:56 me escribiste: Leandro Lucarella wrote: This seems nice. I think it would be nice if this kind of things are commented in the NG before a compiler release, to allow community input and discussion. Yup, that's what happene

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
bearophile wrote: Andrei Alexandrescu: How often did you encounter that issue? Please, let's be serious, and let's stop adding special cases to D, or they will kill the language. Don't get me going about what could kill the language. Lately I have seen too many special cases. For example t

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Leandro Lucarella
Andrei Alexandrescu, el 7 de julio a las 10:56 me escribiste: > Leandro Lucarella wrote: > >This seems nice. I think it would be nice if this kind of things are > >commented in the NG before a compiler release, to allow community input > >and discussion. > > Yup, that's what happened to case :o).

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread bearophile
Andrei Alexandrescu: > How often did you encounter that issue? Please, let's be serious, and let's stop adding special cases to D, or they will kill the language. Lately I have seen too many special cases. For example the current design of the rules of integral seems bad. It has bugs and special

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:h2vprn$1t7...@digitalmars.com... This is a different beast. We simply couldn't devise a satisfactory scheme within the constraints we have. No simple solution we could think of has worked, nor have a number of sophisticated sol

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Jérôme M. Berger wrote: - A floating point range should allow you to specify the iteration step, or else it should allow you to iterate through all numbers that can be represented with the corresponding precision; We don't have that, so you'd need to use a straigh for statement. - The secon

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:h2vprn$1t7...@digitalmars.com... > > This is a different beast. We simply couldn't devise a satisfactory scheme > within the constraints we have. No simple solution we could think of has > worked, nor have a number of sophisticated solutions. Ideas wo

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Jérôme M. Berger
Andrei Alexandrescu wrote: Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Derek Parnell wrote: It seems that D would benefit from having a standard syntax format for expressing variou

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Walter Bright
Andrei Alexandrescu wrote: Bill Baxter wrote: 2009/7/7 Andrei Alexandrescu : I think Walter's message really rendered the whole discussion moot. Post of the year: = I like: a .. b+1 to mean inclusive range. = Not everything is an integer.

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Andrei Alexandrescu, el 7 de julio a las 13:18 me escribiste: Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Derek Parnell wrote: It seems that D would benefit from having a standard syntax format for expressing various range sets; a. Include begin Include end, i

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Derek Parnell wrote: It seems that D would benefit from having a standard syntax format for expressing various range sets; a. Include be

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Leandro Lucarella
Andrei Alexandrescu, el 7 de julio a las 13:18 me escribiste: > Jérôme M. Berger wrote: > >Andrei Alexandrescu wrote: > >>Derek Parnell wrote: > >>>It seems that D would benefit from having a standard syntax format for > >>>expressing various range sets; > >>> a. Include begin Include end, i.e. []

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Jérôme M. Berger
Andrei Alexandrescu wrote: Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Derek Parnell wrote: It seems that D would benefit from having a standard syntax format for expressing various range sets; a. Include begin Include end, i.e. []

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Derek Parnell wrote: It seems that D would benefit from having a standard syntax format for expressing various range sets; a. Include begin Include end, i.e. [] b. Include begin Exclude end

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Bill Baxter wrote: 2009/7/7 Andrei Alexandrescu : I think Walter's message really rendered the whole discussion moot. Post of the year: = I like: a .. b+1 to mean inclusive range. = Not everything is an integer. Works with pointers too. A

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Bill Baxter
2009/7/7 Andrei Alexandrescu : > I think Walter's message really rendered the whole discussion moot. Post of > the year: > > = > I like: > >   a .. b+1 > > to mean inclusive range. > = Not everything is an integer. --bb

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread bearophile
Andrei Alexandrescu: > Safe D is concerned with memory safety only. And hopefully you will understand that is wrong :-) Bye, bearophile

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread bearophile
Andrei Alexandrescu: > I think Walter's message really rendered the whole discussion moot. Post > of the year: > = > I like: > a .. b+1 > to mean inclusive range. That was my preferred solution, starting from months ago. Bye, bearophile

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Jérôme M. Berger
Andrei Alexandrescu wrote: Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Derek Parnell wrote: It seems that D would benefit from having a standard syntax format for expressing various range sets; a. Include begin Include end, i.e. [] b. Include begin Exclude end, i.e. [) c. Exclude beg

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Jérôme M. Berger
Robert Jacques wrote: On Tue, 07 Jul 2009 03:33:24 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: BTW: this means byte and short are not closed under arithmetic operations, which drastically limit their usefulness. I think they shouldn't be closed because they overflow for relativel

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Robert Jacques wrote: On Tue, 07 Jul 2009 11:36:26 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: Andrei, I have a short vector template (think vec!(byte,3), etc) where I've had to wrap the majority lines of code in cast(T)( ... ), because I support bytes and shorts. I find that bot

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Jérôme M. Berger wrote: Andrei Alexandrescu wrote: Derek Parnell wrote: It seems that D would benefit from having a standard syntax format for expressing various range sets; a. Include begin Include end, i.e. [] b. Include begin Exclude end, i.e. [) c. Exclude begin Include end, i.e. (] d.

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Jérôme M. Berger
Andrei Alexandrescu wrote: Derek Parnell wrote: It seems that D would benefit from having a standard syntax format for expressing various range sets; a. Include begin Include end, i.e. [] b. Include begin Exclude end, i.e. [) c. Exclude begin Include end, i.e. (] d. Exclude begin Exclude end

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Robert Jacques
On Tue, 07 Jul 2009 11:36:26 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: Andrei, I have a short vector template (think vec!(byte,3), etc) where I've had to wrap the majority lines of code in cast(T)( ... ), because I support bytes and shorts. I find that both a kludge and a pai

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Moritz Warning
On Tue, 07 Jul 2009 08:53:49 +0200, Lars T. Kyllingstad wrote: > Ary Borenszweig wrote: >> のしいか (noshiika) escribió: >>> Thank you for the great work, Walter and all the other contributors. >>> >>> But I am a bit disappointed with the CaseRangeStatement syntax. Why is >>> it >>>case 0: .. case

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Jarrett Billingsley
On Tue, Jul 7, 2009 at 11:33 AM, Andrei Alexandrescu wrote: > > Well 32-bit architectures may be a historical relic but I don't think 32-bit > integers are. And I think it would be too disruptive a change to promote > results of arithmetic operation between integers to long. > > ... > > This is a d

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Leandro Lucarella wrote: This seems nice. I think it would be nice if this kind of things are commented in the NG before a compiler release, to allow community input and discussion. Yup, that's what happened to case :o). I think this kind of things are the ones that deserves some kind of RFC

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Leandro Lucarella
Andrei Alexandrescu, el 7 de julio a las 00:48 me escribiste: > Robert Jacques wrote: > >On Mon, 06 Jul 2009 01:05:10 -0400, Walter Bright > > > >wrote: > >>Something for everyone here. > >> > >> > >>http://www.digitalmars.com/d/1.0/changelog.html > >>http://ftp.digitalmars.com/dmd.1.046.zip > >

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Robert Jacques wrote: On Tue, 07 Jul 2009 03:33:24 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: That's really cool. But I don't think that's actually happening (Or are these the bugs you're talking about?): byte x,y; short z; z = x+y; // Error: cannot implicitly conv

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Andrei Alexandrescu
Jarrett Billingsley wrote: The only thing is: why doesn't _this_ fail, then? int x, y, z; z = x + y; I'm sure it's out of convenience, but what about in ten, fifteen years when 32-bit architectures are a historical relic and there's still this hole in the type system? Well 32-bit architecture

Re: dmd 1.046 and 2.031 releases

2009-07-07 Thread Robert Jacques
On Tue, 07 Jul 2009 03:33:24 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: That's really cool. But I don't think that's actually happening (Or are these the bugs you're talking about?): byte x,y; short z; z = x+y; // Error: cannot implicitly convert expression (cas

  1   2   3   >