Re: segfaults

2010-05-03 Thread Lars T. Kyllingstad
On Tue, 04 May 2010 09:25:30 +1200, Bernard Helyer wrote: > On 04/05/10 08:57, Lars T. Kyllingstad wrote: >> On Mon, 03 May 2010 15:54:28 -0500, Ellery Newcomer wrote: >> >>> Hello. >>> >>> I'm trying to invoke a command inside d, and it returns a success code >>> when the command in question segf

Re: D 2.0 Sockets

2010-05-03 Thread Kai Ninomiya
On 5/3/2010 10:15 AM, Jesse Phillips wrote: If you're using Linux, then you're probably running into this issue: http://d.puremagic.com/issues/show_bug.cgi?id=2835 Both of us were using both Windows and Linux at different times, and we both tested locally. I will look into this bug/patch fur

Tuple unittests

2010-05-03 Thread Ellery Newcomer
lately I've been getting a lot of screwy error messages whenever I try to compile with -unittest: /home/ellery/Downloads/dmd2044/linux/bin/../../src/phobos/std/typecons.d(425): Error: static assert (is(Tuple!(string,float) == Tuple!(string,float))) is false /home/ellery/Downloads/dmd2044/linu

Re: segfaults

2010-05-03 Thread Ellery Newcomer
On 05/03/2010 06:08 PM, Graham Fawcett wrote: What OS are you running on? In D2, this the definition of system(): int system(string command) { if (!command) return std.c.process.system (null); const commandz = toStringz (command); invariant status = std.c.process.

Re: Operators overloading in D2 again

2010-05-03 Thread bearophile
Dan: > I'm still really sceptic, especially because they look to me inconsistent to > each > other. Yes, they seem divided in two groups, with different level of complexity, etc. This is true, and I think this is by design, opCmp and opEquals and few others are useful in many classes. While ove

Re: Operators overloading in D2 again

2010-05-03 Thread Dan
I'm still really sceptic, especially because they look to me inconsistent to each other. for example opBinary(string op:"something here")(Object other) and then ther is opCmp(Obejct other) which is not template and there is only one for all these operators < <= > >= Did I understand correctly? if

Re: segfaults

2010-05-03 Thread Graham Fawcett
On Mon, 03 May 2010 17:34:51 -0500, Ellery Newcomer wrote: > On 05/03/2010 04:49 PM, Steven Schveighoffer wrote: >> >> Could it be perhaps that it can't possibly get at that status? >> Remember, system runs /bin/sh -c, so all you can get as status is the >> return code of /bin/sh (which didn't seg

Re: segfaults

2010-05-03 Thread Ellery Newcomer
On 05/03/2010 04:49 PM, Steven Schveighoffer wrote: Could it be perhaps that it can't possibly get at that status? Remember, system runs /bin/sh -c, so all you can get as status is the return code of /bin/sh (which didn't segfault). -Steve All I know is the analogous code in python returns th

Re: segfaults

2010-05-03 Thread Bernard Helyer
On 04/05/10 09:49, Steven Schveighoffer wrote: On Mon, 03 May 2010 17:25:30 -0400, Bernard Helyer wrote: I believe his problem is that the return code of the caller indicates success. Could it be perhaps that it can't possibly get at that status? Remember, system runs /bin/sh -c, so all you

Re: segfaults

2010-05-03 Thread Steven Schveighoffer
On Mon, 03 May 2010 17:25:30 -0400, Bernard Helyer wrote: On 04/05/10 08:57, Lars T. Kyllingstad wrote: On Mon, 03 May 2010 15:54:28 -0500, Ellery Newcomer wrote: Hello. I'm trying to invoke a command inside d, and it returns a success code when the command in question segfaults. any ide

Re: segfaults

2010-05-03 Thread Bernard Helyer
On 04/05/10 08:57, Lars T. Kyllingstad wrote: On Mon, 03 May 2010 15:54:28 -0500, Ellery Newcomer wrote: Hello. I'm trying to invoke a command inside d, and it returns a success code when the command in question segfaults. any ideas? // the caller import std.process; int main(){ auto

Re: segfaults

2010-05-03 Thread Lars T. Kyllingstad
On Mon, 03 May 2010 15:54:28 -0500, Ellery Newcomer wrote: > Hello. > > I'm trying to invoke a command inside d, and it returns a success code > when the command in question segfaults. > > any ideas? > > // the caller > import std.process; > > int main(){ > auto r = system("./test"); >

segfaults

2010-05-03 Thread Ellery Newcomer
Hello. I'm trying to invoke a command inside d, and it returns a success code when the command in question segfaults. any ideas? // the caller import std.process; int main(){ auto r = system("./test"); return(r); } //test.d import std.stdio; void main() { Object o; writeln

Re: Operators overloading in D2 again

2010-05-03 Thread Lars T. Kyllingstad
On Mon, 03 May 2010 14:28:20 +, Dan wrote: > it certainly helps. However I can't help myself, I still thinking that > this is the most complicated, hard read and to understand way to > overload operators. Maybe there is something I'm missing but I can't > really see the reason of all that. Othe

Re: Operators overloading in D2 again

2010-05-03 Thread Lars T. Kyllingstad
On Mon, 03 May 2010 16:46:41 +, Lars T. Kyllingstad wrote: > [...] > > Pair opBinary(string op)(Pair p) > { > auto r = this; > r.opOpAssign!op(p); Sorry, that last line should be: r.opOpAssign!(op~"=")(p); -Lars

Re: Operators overloading in D2 again

2010-05-03 Thread Pelle
On 05/03/2010 04:28 PM, Dan wrote: Hi, it certainly helps. However I can't help myself, I still thinking that this is the most complicated, hard read and to understand way to overload operators. Maybe there is something I'm missing but I can't really see the reason of all that. Other languages

Re: Operators overloading in D2 again

2010-05-03 Thread Dan
Hi, it certainly helps. However I can't help myself, I still thinking that this is the most complicated, hard read and to understand way to overload operators. Maybe there is something I'm missing but I can't really see the reason of all that. Other languages adopts a much easier approach, for e

Re: D 2.0 Sockets

2010-05-03 Thread Jesse Phillips
Kai Ninomiya wrote: > Hello all, > > A friend and I recently attempted to write a simple bidirectional > networking (eg. chat) application in D 2.0. We ran into some trouble, > and as this was the first time we had dealt with sockets we struggled > with it quite a bit. We then tried very simila

D 2.0 Sockets

2010-05-03 Thread Kai Ninomiya
Hello all, A friend and I recently attempted to write a simple bidirectional networking (eg. chat) application in D 2.0. We ran into some trouble, and as this was the first time we had dealt with sockets we struggled with it quite a bit. We then tried very similar code in Java (in case of an