Re: dmd 2.029 release

2009-04-23 Thread Georg Wrede
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 it through one of

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
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. Andrei

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:

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:

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!

Re: dmd 2.029 release

2009-04-23 Thread grauzone
No! rant 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

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 Masahiro Nakagawa
On Thu, 23 Apr 2009 18:09:06 +0900, Andrei Alexandrescu seewebsiteforem...@erdani.org 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.

Re: dmd 2.029 release

2009-04-23 Thread Denis Koroskin
On Thu, 23 Apr 2009 16:20:03 +0400, Don nos...@nospam.com 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

Re: dmd 2.029 release

2009-04-23 Thread Andrei Alexandrescu
Don wrote: No! rant 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

Re: dmd 2.029 release

2009-04-23 Thread Steven Schveighoffer
On Thu, 23 Apr 2009 09:06:38 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org 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

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 seewebsiteforem...@erdani.org 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

Re: dmd 2.029 release

2009-04-23 Thread Steven Schveighoffer
On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org 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

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 nos...@nospam.com 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,

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:

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 seewebsiteforem...@erdani.org 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:

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 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 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 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 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 Denis Koroskin
On Thu, 23 Apr 2009 17:35:59 +0400, Frits van Bommel fvbom...@remwovexcapss.nl wrote: Denis Koroskin wrote: On Thu, 23 Apr 2009 16:20:03 +0400, Don nos...@nospam.com wrote: struct Foo(A, B, C){ A[10] a; B b; C c; void toString(Sink sink){ foreach(x; a) sink(x); sink(b);

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

Re: dmd 2.029 release

2009-04-23 Thread Tomas Lindquist Olsen
On Thu, Apr 23, 2009 at 2:37 PM, Don nos...@nospam.com 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

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

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 seewebsiteforem...@erdani.org 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

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:

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 seewebsiteforem...@erdani.org wrote: Steven Schveighoffer wrote: This has to go into object.d and be part of the runtime, where std.range doesn't exist. There

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 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.

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 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

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 Steven Schveighoffer
On Thu, 23 Apr 2009 10:30:15 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Daniel Keep wrote: Andrei Alexandrescu wrote: Steven Schveighoffer wrote: On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Steven Schveighoffer wrote:

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

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

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 writeln. Or at

Re: dmd 2.029 release

2009-04-23 Thread Denis Koroskin
On Thu, 23 Apr 2009 18:28:53 +0400, Andrei Alexandrescu seewebsiteforem...@erdani.org 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

Re: dmd 2.029 release

2009-04-23 Thread Denis Koroskin
On Thu, 23 Apr 2009 19:34:38 +0400, Don nos...@nospam.com 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 digest it and its new

Re: dmd 2.029 release [OT]

2009-04-23 Thread Steven Schveighoffer
On Thu, 23 Apr 2009 12:09:20 -0400, Georg Wrede georg.wr...@iki.fi 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

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 Jarrett Billingsley
On Thu, Apr 23, 2009 at 2:32 PM, Georg Wrede georg.wr...@iki.fi 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.

Re: dmd 2.029 release [OT]

2009-04-23 Thread Steven Schveighoffer
On Thu, 23 Apr 2009 14:32:13 -0400, Georg Wrede georg.wr...@iki.fi wrote: Steven Schveighoffer wrote: On Thu, 23 Apr 2009 12:09:20 -0400, Georg Wrede georg.wr...@iki.fi wrote: (OT: an excellent example of this It's Done Because We Noticed We Could stuff is in Firefox. When a picture is a

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

Re: dmd 2.029 release

2009-04-23 Thread Jarrett Billingsley
On Thu, Apr 23, 2009 at 6:01 PM, Christopher Wright dhase...@gmail.com 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);    

Re: dmd 2.029 release [OT]

2009-04-23 Thread Nick Sabalausky
Steven Schveighoffer schvei...@yahoo.com 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 Jesse Phillips
On Thu, 23 Apr 2009 21:40:36 -0400, Christopher Wright wrote: Nick Sabalausky wrote: Steven Schveighoffer schvei...@yahoo.com 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

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 IM

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 squad offense ;) I'd

dstats updated for new Phobos

2009-04-23 Thread dsimcha
My statistics library for D, dstats, has been updated to take advantage of the concepts introduced in the new Phobos: http://dsource.org/projects/dstats . It has also received several smaller miscellaneous updates: 1. Instead of being specific to arrays, all functions now accept the most