Re: dmd 2.029 release

2009-04-28 Thread Walter Bright
Georg Wrede wrote: Walter Bright wrote: I see I was being too obscure. See "Colossus, the Forbin Project" http://us.imdb.com/title/tt0064177/ Heh, by an incredible coincidence, it aired here a couple of weeks ago. Maybe that's why I felt the reference too obvious to comment on. I think it i

Re: dmd 2.029 release

2009-04-28 Thread Georg Wrede
Walter Bright wrote: Georg Wrede wrote: Walter Bright wrote: Lutger wrote: what the hell...this code can't be human. I was replaced by Colossus years ago. Michael A. Jackson wouldn't approve 1175 gotos in 113 files. I see I was being too obscure. See "Colossus, the Forbin Project" http:/

Re: dmd 2.029 release [OT]

2009-04-27 Thread Benji Smith
Georg Wrede wrote: Jarrett Billingsley wrote: I mean, who's such a nutcase that he forgets halfway in the dragging, what it is he's dragging? Middle-click. Yeah. But I still don't see the glamouros advantages in dragging whole pictures. And I often drag stuff to existing tabs. A good exam

Re: dmd 2.029 release

2009-04-27 Thread Nick Sabalausky
"renoX" wrote in message news:49f56a74.4000...@free.fr... > Nick Sabalausky a écrit : >> "bearophile" wrote in message >> news:gsipn1$1bn...@digitalmars.com... >>> Andrei Alexandrescu: If it were an error, I wouldn't let it go. >>> It's an error. It will lead to troubles. >>> >> >> Sometime

Re: dmd 2.029 release

2009-04-27 Thread Sean Kelly
Stewart Gordon wrote: Walter Bright wrote: Stewart Gordon wrote: Walter, how often do you update your working copy from the SVN? Obviously less than once every 2 releases. As far as I know, it is current. Everything got checked in. So how has the fix for http://d.puremagic.com/issues/show_b

Re: dmd 2.029 release

2009-04-27 Thread Christopher Wright
Walter Bright wrote: Georg Wrede wrote: Walter Bright wrote: Lutger wrote: what the hell...this code can't be human. I was replaced by Colossus years ago. Michael A. Jackson wouldn't approve 1175 gotos in 113 files. I see I was being too obscure. See "Colossus, the Forbin Project" http:

Re: dmd 2.029 release

2009-04-27 Thread Walter Bright
Georg Wrede wrote: Yeah. But now I'm getting a bad conscience, this is beginning to look like Walter-bashing... :-) Don't worry, I'm immune to that. Back in 1984 or so during a code review at work, a colleague grepped for goto and presented a listing of all the gotos with the comment about wh

Re: dmd 2.029 release

2009-04-27 Thread Walter Bright
Don wrote: Actually, looking through the DMD source it becomes obvious that goto is really not a problem at all. The lack of comments is much more of a problem. (Especially with files with names like "e2ir.c". e2ir => Expression To Intermediate Representation What the heck is "fltables.c",

Re: dmd 2.029 release

2009-04-27 Thread Walter Bright
Stewart Gordon wrote: So how has the fix for http://d.puremagic.com/issues/show_bug.cgi?id=2580 (and probably others) not been included? I'll look into it.

Re: dmd 2.029 release

2009-04-27 Thread Walter Bright
Georg Wrede wrote: Walter Bright wrote: Lutger wrote: what the hell...this code can't be human. I was replaced by Colossus years ago. Michael A. Jackson wouldn't approve 1175 gotos in 113 files. I see I was being too obscure. See "Colossus, the Forbin Project" http://us.imdb.com/title/tt

Re: dmd 2.029 release

2009-04-27 Thread renoX
Nick Sabalausky a écrit : "bearophile" wrote in message news:gsipn1$1bn...@digitalmars.com... Andrei Alexandrescu: If it were an error, I wouldn't let it go. It's an error. It will lead to troubles. Sometimes it is an error, but there are times when it isn't: [cut] Call List In Psuedo-Ja

Re: dmd 2.029 release

2009-04-27 Thread renoX
Nick Sabalausky a écrit : "bearophile" wrote in message news:gsipn1$1bn...@digitalmars.com... Andrei Alexandrescu: If it were an error, I wouldn't let it go. It's an error. It will lead to troubles. Sometimes it is an error, but there are times when it isn't: [cut] Call List In Psuedo-Ja

Re: dmd 2.029 release

2009-04-25 Thread U u
Tomas Lindquist Olsen Wrote: > On Mon, Apr 20, 2009 at 2:47 PM, Saaa wrote: > > Using D1 feels especially retarded today :( > > > > Why retarded ? I think because of new features *cough* featurism *cough*

Re: dmd 2.029 release

2009-04-25 Thread U u
Tomas Lindquist Olsen Wrote: > On Mon, Apr 20, 2009 at 2:47 PM, Saaa wrote: > > Using D1 feels especially retarded today :( > > > > Why retarded ? I think because of new features *cough* featurism *cough*

Re: dmd 2.029 release

2009-04-25 Thread Don
Don wrote: bearophile wrote: Isn't sin(x)+sin(x) pure? Even if the compiler doesn't want to replace x+x with x*2 because x is a floating point, it can do: y = sin(x) y+y And that gives the same result even with FPs. Yes. From further investigation, I've found that: (1) the optimisation of

Re: dmd 2.029 release [OT]

2009-04-25 Thread BCS
Hello Nick, I guess if you really hate having it not kill the app then the program could just not /have/ a x button. You've got to be kidding me, that would be just as bad. Why would I want to have a program get rid of the standard "exit" mechanism? If you basicly never want to exit it? (see

Re: dmd 2.029 release [OT]

2009-04-24 Thread Nick Sabalausky
"BCS" wrote in message news:78ccfa2d3ebc18cb92e7b8abe...@news.digitalmars.com... > > Are you saying you never make mistakes? There are program out there that > 90% of the time when I hit the x button it was a mistake and in that cases > I think it to be a good design to work around it. ?? Not

Re: dmd 2.029 release [OT]

2009-04-24 Thread BCS
Reply to Christopher, BCS wrote: I guess if you really hate having it not kill the app then the program could just not /have/ a x button. Your window manager does not support such windows. So I guess we're stuck with the no-close close button if we don't want any way to close the app in

Re: dmd 2.029 release [OT]

2009-04-24 Thread Christopher Wright
BCS wrote: I guess if you really hate having it not kill the app then the program could just not /have/ a x button. Your window manager does not support such windows.

Re: dmd 2.029 release

2009-04-24 Thread Christopher Wright
Andrei Alexandrescu wrote: grauzone wrote: Simen Kjaeraas wrote: Do note that I might have misinterpreted it all, as Andrei's code would not do what I have outlined above, I only feel it makes the most sense. Yeah OK, but what about virtual functions? Not having it virtual is a real disadva

Re: dmd 2.029 release [OT]

2009-04-24 Thread Steven Schveighoffer
On Fri, 24 Apr 2009 14:00:19 -0400, Nick Sabalausky wrote: "BCS" wrote in message news:a6268ff50d58cb92d952e5b...@news.digitalmars.com... Hello Nick, "BCS" wrote in message news:a6268ff50558cb926917215...@news.digitalmars.com... yah, for some programs you rarely want to close the program

Re: dmd 2.029 release [OT]

2009-04-24 Thread BCS
Reply to Nick, "BCS" wrote in message news:a6268ff50d58cb92d952e5b...@news.digitalmars.com... Hello Nick, "BCS" wrote in message news:a6268ff50558cb926917215...@news.digitalmars.com... yah, for some programs you rarely want to close the program but often want to close the UI. That's cal

Re: dmd 2.029 release [OT]

2009-04-24 Thread Nick Sabalausky
"BCS" wrote in message news:a6268ff50d58cb92d952e5b...@news.digitalmars.com... > Hello Nick, > >> "BCS" wrote in message >> news:a6268ff50558cb926917215...@news.digitalmars.com... >> >>> yah, for some programs you rarely want to close the program but often >>> want to close the UI. >>> >> That's

Re: dmd 2.029 release [OT]

2009-04-24 Thread BCS
Hello Nick, "BCS" wrote in message news:a6268ff50558cb926917215...@news.digitalmars.com... yah, for some programs you rarely want to close the program but often want to close the UI. That's called "Minimize". It can be, OTOH I might want the UI process killed without killing the main pr

Re: dmd 2.029 release

2009-04-24 Thread grauzone
Andrei Alexandrescu wrote: grauzone wrote: Simen Kjaeraas wrote: Do note that I might have misinterpreted it all, as Andrei's code would not do what I have outlined above, I only feel it makes the most sense. Yeah OK, but what about virtual functions? Not having it virtual is a real disadva

Re: dmd 2.029 release

2009-04-24 Thread Andrei Alexandrescu
grauzone wrote: Simen Kjaeraas wrote: Do note that I might have misinterpreted it all, as Andrei's code would not do what I have outlined above, I only feel it makes the most sense. Yeah OK, but what about virtual functions? Not having it virtual is a real disadvantage, because subclass-part

Re: dmd 2.029 release [OT]

2009-04-24 Thread Georg Wrede
grauzone wrote: It took me some serious browsing before I found a non-obtrusive skin for gmplayer. And I hated to have to do that. It should have been the default. AFAIK, the gmplayer GUI is deprecated. Use mplayer or smplayer. smplayer is a GUI for mplayer that surprisingly manages to use a

Re: dmd 2.029 release [OT]

2009-04-24 Thread Georg Wrede
Nick Sabalausky wrote: "Georg Wrede" wrote in message news:gsrrfn$kv...@digitalmars.com... Those video editors, iTunes and such look like they're programmed by 12-year olds. Somewhere there should be an adult saying what not to do! Well put. I bet the guy who did this never expected that w

Re: dmd 2.029 release

2009-04-24 Thread grauzone
Simen Kjaeraas wrote: grauzone wrote: void streamOut(T, R)(T object, R range) { foreach(x; a) range.put(x); range.put(b); range.put(c); } So, um... what is a b c and T object? In my opinion, this is a confusing example. I believe it was meant to be: void streamOut(T, R)(T objec

Re: dmd 2.029 release

2009-04-24 Thread Simen Kjaeraas
grauzone wrote: void streamOut(T, R)(T object, R range) { foreach(x; a) range.put(x); range.put(b); range.put(c); } So, um... what is a b c and T object? In my opinion, this is a confusing example. I believe it was meant to be: void streamOut(T, R)(T object, R range) { foreach(

Re: dmd 2.029 release [OT]

2009-04-24 Thread grauzone
It took me some serious browsing before I found a non-obtrusive skin for gmplayer. And I hated to have to do that. It should have been the default. AFAIK, the gmplayer GUI is deprecated. Use mplayer or smplayer. smplayer is a GUI for mplayer that surprisingly manages to use a standard GUI, an

Re: dmd 2.029 release [OT]

2009-04-24 Thread Denis Koroskin
On Fri, 24 Apr 2009 13:54:26 +0400, Nick Sabalausky wrote: "BCS" wrote in message news:a6268ff50558cb926917215...@news.digitalmars.com... Hello Christopher, Nick Sabalausky wrote: The absolute worst of all though is when an app (*cough* skype *cough*) decides that "close" and "the 'close'

Re: dmd 2.029 release [OT]

2009-04-24 Thread Nick Sabalausky
"Georg Wrede" wrote in message news:gsrqbj$iu...@digitalmars.com... > Steven Schveighoffer wrote: >> On Thu, 23 Apr 2009 14:32:13 -0400, Georg Wrede >> wrote: >>> I mean, who's such a nutcase that he forgets halfway in the dragging, >>> what it is he's dragging? >> >> It might be useful if you

Re: dmd 2.029 release [OT]

2009-04-24 Thread Nick Sabalausky
"Georg Wrede" wrote in message news:gsrrfn$kv...@digitalmars.com... > > Those video editors, iTunes and such look like they're programmed by > 12-year olds. Somewhere there should be an adult saying what not to do! > Well put. > I bet the guy who did this never expected that whole-picture drag

Re: dmd 2.029 release [OT]

2009-04-24 Thread Nick Sabalausky
"BCS" wrote in message news:a6268ff50558cb926917215...@news.digitalmars.com... > Hello Christopher, > >> Nick Sabalausky wrote: >> >>> The absolute worst of all though is when an app (*cough* skype >>> *cough*) decides that "close" and "the 'close' button" should mean >>> "don't close anything at

Re: dmd 2.029 release [OT]

2009-04-24 Thread Georg Wrede
Nick Sabalausky wrote: "Steven Schveighoffer" wrote in message news:op.usux6bskeav...@steves.networkengines.com... I was never a huge fan of application themes. I don't mind a theme for the whole system (as long as it's simple), but I don't want iTunes to look different just because it can.

Re: dmd 2.029 release [OT]

2009-04-24 Thread Georg Wrede
Steven Schveighoffer wrote: On Thu, 23 Apr 2009 14:32:13 -0400, Georg Wrede wrote: Steven Schveighoffer wrote: On Thu, 23 Apr 2009 12:09:20 -0400, Georg Wrede So now I have to learn to remember to grab bigger pictures near some edge. And I really can't see *any* valid benefit for having to d

Re: dmd 2.029 release [OT]

2009-04-24 Thread Georg Wrede
Jarrett Billingsley wrote: On Thu, Apr 23, 2009 at 2:32 PM, Georg Wrede wrote: (OT: an excellent example of this It's Done Because We Noticed We Could stuff is in Firefox. When a picture is a link to another page, and you want to drag that to the tab area, the entire picture is dragged with th

Re: dmd 2.029 release [OT]

2009-04-24 Thread Georg Wrede
Steven Schveighoffer wrote: On Thu, 23 Apr 2009 14:32:13 -0400, Georg Wrede wrote: I mean, who's such a nutcase that he forgets halfway in the dragging, what it is he's dragging? It might be useful if you accidentally start dragging the wrong thing, and then realize because you are dragging

Re: dmd 2.029 release [OT]

2009-04-23 Thread Daniel Keep
BCS wrote: > Hello Christopher, > >> Nick Sabalausky wrote: >> >>> The absolute worst of all though is when an app (*cough* skype >>> *cough*) decides that "close" and "the 'close' button" should mean >>> "don't close anything at all, but minimize to tray instead". That >>> should be a firing

Re: dmd 2.029 release [OT]

2009-04-23 Thread BCS
Hello Christopher, Nick Sabalausky wrote: The absolute worst of all though is when an app (*cough* skype *cough*) decides that "close" and "the 'close' button" should mean "don't close anything at all, but minimize to tray instead". That should be a firing squad offense ;) I'd be killing my

Re: dmd 2.029 release [OT]

2009-04-23 Thread Jesse Phillips
On Thu, 23 Apr 2009 21:40:36 -0400, Christopher Wright wrote: > Nick Sabalausky wrote: >> "Steven Schveighoffer" wrote in message >> news:op.usux6bskeav...@steves.networkengines.com... >>> I was never a huge fan of application themes. I don't mind a theme >>> for the whole system (as long as it'

Re: dmd 2.029 release [OT]

2009-04-23 Thread Christopher Wright
Nick Sabalausky wrote: "Steven Schveighoffer" wrote in message news:op.usux6bskeav...@steves.networkengines.com... I was never a huge fan of application themes. I don't mind a theme for the whole system (as long as it's simple), but I don't want iTunes to look different just because it can.

Re: dmd 2.029 release [OT]

2009-04-23 Thread Nick Sabalausky
"Steven Schveighoffer" wrote in message news:op.usux6bskeav...@steves.networkengines.com... > > I was never a huge fan of application themes. I don't mind a theme for > the whole system (as long as it's simple), but I don't want iTunes to look > different just because it can. > That's one of

Re: dmd 2.029 release

2009-04-23 Thread Jarrett Billingsley
On Thu, Apr 23, 2009 at 6:01 PM, Christopher Wright wrote: > Andrei Alexandrescu wrote: >> >> Yes. The way it should be is not with sink, but with the standard output >> iterator method put(). >> >> void streamOut(T, R)(T object, R range) >> { >>    foreach(x; a) range.put(x); >>    range.put(b);

Re: dmd 2.029 release

2009-04-23 Thread Christopher Wright
Andrei Alexandrescu wrote: Yes. The way it should be is not with sink, but with the standard output iterator method put(). void streamOut(T, R)(T object, R range) { foreach(x; a) range.put(x); range.put(b); range.put(c); } // object.d class Object { void streamOut(R)(R ran

Re: dmd 2.029 release [OT]

2009-04-23 Thread Steven Schveighoffer
On Thu, 23 Apr 2009 14:32:13 -0400, Georg Wrede wrote: Steven Schveighoffer wrote: On Thu, 23 Apr 2009 12:09:20 -0400, Georg Wrede wrote: (OT: an excellent example of this It's Done Because We Noticed We Could stuff is in Firefox. When a picture is a link to another page, and you want

Re: dmd 2.029 release [OT]

2009-04-23 Thread Jarrett Billingsley
On Thu, Apr 23, 2009 at 2:32 PM, Georg Wrede wrote: >>> (OT: an excellent example of this It's Done Because We Noticed We Could >>> stuff is in Firefox. When a picture is a link to another page, and you want >>> to drag that to the tab area, the entire picture is dragged with the mouse. >>> Now,

Re: dmd 2.029 release [OT]

2009-04-23 Thread Steven Schveighoffer
On Thu, 23 Apr 2009 14:32:13 -0400, Georg Wrede wrote: Steven Schveighoffer wrote: On Thu, 23 Apr 2009 12:09:20 -0400, Georg Wrede wrote: (OT: an excellent example of this It's Done Because We Noticed We Could stuff is in Firefox. When a picture is a link to another page, and you want

Re: dmd 2.029 release [OT]

2009-04-23 Thread Georg Wrede
Steven Schveighoffer wrote: On Thu, 23 Apr 2009 12:09:20 -0400, Georg Wrede wrote: (OT: an excellent example of this It's Done Because We Noticed We Could stuff is in Firefox. When a picture is a link to another page, and you want to drag that to the tab area, the entire picture is dragged w

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: As most ranges are structs (and rightfully so, who wants to call 3 virtual functions every loop!), they would have to be wrapped under the current compiler. Or am I missing something else? Yes, some wrapping would have to be done. Hopefully it will simple enough

Re: dmd 2.029 release [OT]

2009-04-23 Thread Steven Schveighoffer
On Thu, 23 Apr 2009 12:09:20 -0400, Georg Wrede wrote: (OT: an excellent example of this It's Done Because We Noticed We Could stuff is in Firefox. When a picture is a link to another page, and you want to drag that to the tab area, the entire picture is dragged with the mouse. Now, how th

Re: dmd 2.029 release

2009-04-23 Thread Denis Koroskin
On Thu, 23 Apr 2009 18:28:53 +0400, Andrei Alexandrescu wrote: > Denis Koroskin wrote: >> Sink is okay, but most my usages belong to one of the two scenarios: 1) >> I need a string representation of an Object - how is Sink useful >> here? I just want to call obj.toString() and get the result 2

Re: dmd 2.029 release

2009-04-23 Thread Denis Koroskin
On Thu, 23 Apr 2009 19:34:38 +0400, Don wrote: > Georg Wrede wrote: >> Don wrote: >>> Georg Wrede wrote: Don wrote: > Georg Wrede wrote: >> Don wrote: >>> bearophile wrote: This post is mostly for Andrei. I have played with D2 a bit; probably I'll need months to

Re: dmd 2.029 release

2009-04-23 Thread Joel C. Salomon
Georg Wrede wrote: > Don wrote: >> Georg Wrede wrote: >>> One thing we sholuld be wary of is overdesign. BigInt is ok, but by >>> the time we try to include a class called >>> CompleteSimulationOfAnF1RaceCar, we're screwed. :-) I see no way to >>> incorporate them into writefln or even plain write

Re: dmd 2.029 release

2009-04-23 Thread Georg Wrede
bearophile wrote: Don: toString() is one of the most dreadful features in D. It's also one of the most useful, and it's quite easy to understand and use. You need very little brain to use it. Features that require little/no brain are very important to me (but surely it's a quality that is at t

Re: dmd 2.029 release

2009-04-23 Thread Charles Hixson
Georg Wrede wrote: Don wrote: Georg Wrede wrote: Don wrote: Georg Wrede wrote: Walter Bright wrote: Lutger wrote: what the hell...this code can't be human. I was replaced by Colossus years ago. Michael A. Jackson wouldn't approve 1175 gotos in 113 files. It'd be really funny to pass i

Re: dmd 2.029 release

2009-04-23 Thread Georg Wrede
Don wrote: Georg Wrede wrote: One thing we sholuld be wary of is overdesign. BigInt is ok, but by the time we try to include a class called CompleteSimulationOfAnF1RaceCar, we're screwed. :-) I see no way to incorporate them into writefln or even plain writeln. Or at least, no *use*. I thi

Re: dmd 2.029 release

2009-04-23 Thread Steven Schveighoffer
On Thu, 23 Apr 2009 10:30:15 -0400, Andrei Alexandrescu wrote: Daniel Keep wrote: Andrei Alexandrescu wrote: Steven Schveighoffer wrote: On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu wrote: Steven Schveighoffer wrote: This has to go into object.d and be part of the runtime,

Re: dmd 2.029 release

2009-04-23 Thread bearophile
Don: > toString() is one of the most dreadful features in D. It's also one of the most useful, and it's quite easy to understand and use. You need very little brain to use it. Features that require little/no brain are very important to me (but surely it's a quality that is at the bottom of the

Re: dmd 2.029 release

2009-04-23 Thread Don
Georg Wrede wrote: Don wrote: Georg Wrede wrote: Don wrote: Georg Wrede wrote: Don wrote: bearophile wrote: This post is mostly for Andrei. I have played with D2 a bit; probably I'll need months to digest it and its new Phobos2. While I explore Phobos I'll probably post some comments/bugs

Re: dmd 2.029 release

2009-04-23 Thread bearophile
Simen Kjaeraas: > That actually sounds like a good idea. Like you say, is has no use > outside of debugging, but while debugging, it's quite useful. It's also important for small script-like programs. I am using D to write a lot of them :-) Bye, bearophile

Re: dmd 2.029 release

2009-04-23 Thread Georg Wrede
Don wrote: Georg Wrede wrote: Don wrote: Georg Wrede wrote: Don wrote: bearophile wrote: This post is mostly for Andrei. I have played with D2 a bit; probably I'll need months to digest it and its new Phobos2. While I explore Phobos I'll probably post some comments/bugs around here. Afte

Re: dmd 2.029 release

2009-04-23 Thread Don
Georg Wrede wrote: Don wrote: Georg Wrede wrote: Don wrote: bearophile wrote: This post is mostly for Andrei. I have played with D2 a bit; probably I'll need months to digest it and its new Phobos2. While I explore Phobos I'll probably post some comments/bugs around here. After reading th

Re: dmd 2.029 release

2009-04-23 Thread grauzone
Andrei Alexandrescu wrote: grauzone wrote: Andrei Alexandrescu wrote: grauzone wrote: Yes. The way it should be is not with sink, but with the standard output iterator method put(). void streamOut(T, R)(T object, R range) { foreach(x; a) range.put(x); range.put(b); range.put(c);

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
Daniel Keep wrote: Andrei Alexandrescu wrote: Steven Schveighoffer wrote: On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu wrote: Steven Schveighoffer wrote: This has to go into object.d and be part of the runtime, where std.range doesn't exist. There is nothing stopping you from c

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
Denis Koroskin wrote: Sink is okay, but most my usages belong to one of the two scenarios: 1) I need a string representation of an Object - how is Sink useful here? I just want to call obj.toString() and get the result 2) I need to print it to stdout, thus I call writeln/Stdout(obj); - Sink is o

Re: dmd 2.029 release

2009-04-23 Thread Daniel Keep
Andrei Alexandrescu wrote: > Steven Schveighoffer wrote: >> On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu >> wrote: >> >>> Steven Schveighoffer wrote: This has to go into object.d and be part of the runtime, where std.range doesn't exist. There is nothing stopping you from c

Re: dmd 2.029 release

2009-04-23 Thread Georg Wrede
Don wrote: Georg Wrede wrote: Don wrote: bearophile wrote: This post is mostly for Andrei. I have played with D2 a bit; probably I'll need months to digest it and its new Phobos2. While I explore Phobos I'll probably post some comments/bugs around here. After reading this: http://blogs.msd

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
grauzone wrote: Andrei Alexandrescu wrote: grauzone wrote: Yes. The way it should be is not with sink, but with the standard output iterator method put(). void streamOut(T, R)(T object, R range) { foreach(x; a) range.put(x); range.put(b); range.put(c); } Eh. Is a sink callback t

Re: dmd 2.029 release

2009-04-23 Thread Tomas Lindquist Olsen
On Thu, Apr 23, 2009 at 2:37 PM, Don wrote: > bearophile wrote: >> >> Don: >>> >>> I really don't understand the backend. It's quite cryptic. Key acronyms >>> are AE, CP and VBE. Then there's Bin, Bgen, Bkill, etc. >>> AE *might* be Available Expression (but what does that mean?) >>> CP might be C

Re: dmd 2.029 release

2009-04-23 Thread Georg Wrede
Andrei Alexandrescu wrote: Georg Wrede wrote: Wow! What if writeln would automatically call to!string for any object or struct? That's the plan, I didn't get around to it. I want to do it the right way, i.e. with general streams, not strings. I'm just impressed.

Re: dmd 2.029 release

2009-04-23 Thread Don
Georg Wrede wrote: Don wrote: bearophile wrote: This post is mostly for Andrei. I have played with D2 a bit; probably I'll need months to digest it and its new Phobos2. While I explore Phobos I'll probably post some comments/bugs around here. After reading this: http://blogs.msdn.com/vcblog

Re: dmd 2.029 release

2009-04-23 Thread grauzone
Sink is okay, but most my usages belong to one of the two scenarios: 1) I need a string representation of an Object - how is Sink useful here? I just want to call obj.toString() and get the result 2) I need to print it to stdout, thus I call writeln/Stdout(obj); - Sink is of no use here again.

Re: dmd 2.029 release

2009-04-23 Thread grauzone
Andrei Alexandrescu wrote: grauzone wrote: Yes. The way it should be is not with sink, but with the standard output iterator method put(). void streamOut(T, R)(T object, R range) { foreach(x; a) range.put(x); range.put(b); range.put(c); } Eh. Is a sink callback too simple and eas

Re: dmd 2.029 release

2009-04-23 Thread Denis Koroskin
On Thu, 23 Apr 2009 17:35:59 +0400, Frits van Bommel wrote: > Denis Koroskin wrote: >> On Thu, 23 Apr 2009 16:20:03 +0400, Don wrote: >> >>> struct Foo(A, B, C){ >>> A[10] a; >>> B b; >>> C c; >>> void toString(Sink sink){ >>> foreach(x; a) sink(x); >>> sink(b); >>> sink(c); >>> } >

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
Georg Wrede wrote: Wow! What if writeln would automatically call to!string for any object or struct? That's the plan, I didn't get around to it. I want to do it the right way, i.e. with general streams, not strings. Andrei

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
Frits van Bommel wrote: Andrei Alexandrescu wrote: Steven Schveighoffer wrote: So I'd rather have a sink function. It must be a sink _object_ so it can hold its own state. And it must support put() so it integrates with statically-bound output ranges. interface OutRange { void put(...

Re: dmd 2.029 release

2009-04-23 Thread Georg Wrede
Andrei Alexandrescu wrote: Georg Wrede wrote: Second, since we have cool stuff in D, like templates, boxing, and other advanced things, then compared to them, it should not be a big deal to have automatic creation of toString for structs and objects. (This could even be on-demand, i.e. unless

Re: dmd 2.029 release

2009-04-23 Thread Frits van Bommel
Andrei Alexandrescu wrote: Frits van Bommel wrote: IMHO It'd be pretty nice for the standard formatting systems (both the Tango and Phobos ones) to just call a standard Object method taking (Sink sink, char[] format = null) on objects. Probably we'll need that. You forgot the "in" though :o).

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
Georg Wrede wrote: Second, since we have cool stuff in D, like templates, boxing, and other advanced things, then compared to them, it should not be a big deal to have automatic creation of toString for structs and objects. (This could even be on-demand, i.e. unless called, the toString is not

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
Frits van Bommel wrote: I usually define something like "void streamTo(Sink sink)" in a base class if I want non-allocating output. Adding a format string to the parameter list should be easy, but I haven't needed it yet. I then usually implement toString by passing an appending Sink to that me

Re: dmd 2.029 release

2009-04-23 Thread Frits van Bommel
Andrei Alexandrescu wrote: Steven Schveighoffer wrote: So I'd rather have a sink function. It must be a sink _object_ so it can hold its own state. And it must support put() so it integrates with statically-bound output ranges. interface OutRange { void put(... a number of overloads ...

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu wrote: Steven Schveighoffer wrote: This has to go into object.d and be part of the runtime, where std.range doesn't exist. There is nothing stopping you from calling: streamOut(&outputrange.put); So I'd r

Re: dmd 2.029 release

2009-04-23 Thread Georg Wrede
Don wrote: bearophile wrote: This post is mostly for Andrei. I have played with D2 a bit; probably I'll need months to digest it and its new Phobos2. While I explore Phobos I'll probably post some comments/bugs around here. After reading this: http://blogs.msdn.com/vcblog/archive/2009/04/22/

Re: dmd 2.029 release

2009-04-23 Thread Frits van Bommel
Denis Koroskin wrote: On Thu, 23 Apr 2009 16:20:03 +0400, Don wrote: struct Foo(A, B, C){ A[10] a; B b; C c; void toString(Sink sink){ foreach(x; a) sink(x); sink(b); sink(c); } } ... but it's not, you have to create a silly buffer to put all your strings in, even if there are 20

Re: dmd 2.029 release

2009-04-23 Thread Steven Schveighoffer
On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu wrote: Steven Schveighoffer wrote: This has to go into object.d and be part of the runtime, where std.range doesn't exist. There is nothing stopping you from calling: streamOut(&outputrange.put); So I'd rather have a sink function.

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: On Thu, 23 Apr 2009 09:06:38 -0400, Andrei Alexandrescu wrote: It ought to be at least as simple as: struct Foo(A, B, C){ A[10] a; B b; C c; void toString(Sink sink){ foreach(x; a) sink(x); sink(b); sink(c); } } ... but it's not, you have to create a sill

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
grauzone wrote: Yes. The way it should be is not with sink, but with the standard output iterator method put(). void streamOut(T, R)(T object, R range) { foreach(x; a) range.put(x); range.put(b); range.put(c); } Eh. Is a sink callback too simple and easy to use or what? ? Andre

Re: dmd 2.029 release

2009-04-23 Thread Steven Schveighoffer
On Thu, 23 Apr 2009 09:06:38 -0400, Andrei Alexandrescu wrote: It ought to be at least as simple as: struct Foo(A, B, C){ A[10] a; B b; C c; void toString(Sink sink){ foreach(x; a) sink(x); sink(b); sink(c); } } ... but it's not, you have to create a silly buffer to put all your s

Re: dmd 2.029 release

2009-04-23 Thread grauzone
Yes. The way it should be is not with sink, but with the standard output iterator method put(). void streamOut(T, R)(T object, R range) { foreach(x; a) range.put(x); range.put(b); range.put(c); } Eh. Is a sink callback too simple and easy to use or what?

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
Don wrote: No! toString() is one of the most dreadful features in D. Trying to slightly improve it is a waste of time -- the whole concept needs to be redone. It's horribly inflexible, tedious, and hugely inefficient. What more could there be to hate? I agree. - the object being called has

Re: dmd 2.029 release

2009-04-23 Thread Denis Koroskin
On Thu, 23 Apr 2009 16:20:03 +0400, Don wrote: > bearophile wrote: >> This post is mostly for Andrei. >> I have played with D2 a bit; probably I'll need months to digest it and >> its new Phobos2. While I explore Phobos I'll probably post some >> comments/bugs around here. >> After reading t

Re: dmd 2.029 release

2009-04-23 Thread Masahiro Nakagawa
On Thu, 23 Apr 2009 18:09:06 +0900, Andrei Alexandrescu wrote: Masahiro Nakagawa wrote: I submitted this problem to bugzilla. http://d.puremagic.com/issues/show_bug.cgi?id=2882 Thanks! I fixed it and checked in std.random. Wow! std.random in svn works fine. Thanks for your quick respon

Re: dmd 2.029 release

2009-04-23 Thread Simen Kjaeraas
Don wrote: I'd like to see version(debug) {} put around Object.toString(). It's a deathtrap feature that's got no business being used other than for debugging. That actually sounds like a good idea. Like you say, is has no use outside of debugging, but while debugging, it's quite useful. -

Re: dmd 2.029 release

2009-04-23 Thread grauzone
No! toString() is one of the most dreadful features in D. Trying to slightly improve it is a waste of time -- the whole concept needs to be redone. It's horribly inflexible, tedious, and hugely inefficient. What more could there be to hate? Hey, it's only meant for debugging! (At least I hope

Re: dmd 2.029 release

2009-04-23 Thread Don
bearophile wrote: Don: I really don't understand the backend. It's quite cryptic. Key acronyms are AE, CP and VBE. Then there's Bin, Bgen, Bkill, etc. AE *might* be Available Expression (but what does that mean?) CP might be Copy Propagation info I've found that VBE = "Very Busy Expression"! (w

Re: dmd 2.029 release

2009-04-23 Thread Don
bearophile wrote: This post is mostly for Andrei. I have played with D2 a bit; probably I'll need months to digest it and its new Phobos2. While I explore Phobos I'll probably post some comments/bugs around here. After reading this: http://blogs.msdn.com/vcblog/archive/2009/04/22/decltype-c-0x

Re: dmd 2.029 release

2009-04-23 Thread bearophile
Don: > I really don't understand the backend. It's quite cryptic. Key acronyms > are AE, CP and VBE. Then there's Bin, Bgen, Bkill, etc. > AE *might* be Available Expression (but what does that mean?) > CP might be Copy Propagation info > I've found that VBE = "Very Busy Expression"! (what does th

Re: dmd 2.029 release

2009-04-23 Thread bearophile
This post is mostly for Andrei. I have played with D2 a bit; probably I'll need months to digest it and its new Phobos2. While I explore Phobos I'll probably post some comments/bugs around here. After reading this: http://blogs.msdn.com/vcblog/archive/2009/04/22/decltype-c-0x-features-in-vc10-pa

  1   2   3   >