Re: Memory management and garbage collectors

2010-08-30 Thread JMRyan
Thank you for your reply. It was helpful.

Re: Problems with receive

2010-08-30 Thread Sean Kelly
Stanislav Blinov Wrote: > Stanislav Blinov wrote: > > > > > I'm not sure about Variant part yet (never tried it myself) > > Hmm, after some inspection I can say this is an implementation issue. > > You'll find that there are cases when what's told in TDPL doesn't work > (see recent msg[0] or

Re: Problems with receive

2010-08-30 Thread SK
On Mon, Aug 30, 2010 at 1:21 PM, Stanislav Blinov < stanislav.bli...@gmail.com> wrote: > Philippe Sigaud wrote: > >>static assert( a1.length != 1 || !is( a1.field[0] == Variant ), >> >> >>Is that so? I thought ParameterTypeTuple and Tuple are different. >> >> >> You're right, there are

Re: Problems with receive

2010-08-30 Thread Stanislav Blinov
Philippe Sigaud wrote: static assert( a1.length != 1 || !is( a1.field[0] == Variant ), Is that so? I thought ParameterTypeTuple and Tuple are different. You're right, there are different. ParameterTypeTuple is a type tuple (a bunch of types grouped together, with indexing and

Re: Problems with receive

2010-08-30 Thread Philippe Sigaud
On Mon, Aug 30, 2010 at 12:23, Stanislav Blinov wrote: > 30.08.2010 3:06, SK wrote: > > I encountered this one too and it appears to be a regression in 2.048 that >> did not occur in 2.047. It's the same msg[0] vs. msg.field[0] problem, but >> in concurrency.d itself. It's a one line patch to

Re: How to tell if a file is actually a socket?

2010-08-30 Thread orgoton baberek
On 29/08/2010 17:30, Seth Hoenig wrote: I have a program which does a bit of scanning through files, and right now I'm running into issues where std.File.isfile() is reporting sockets as files, which is problematic, because sockets cause segfaults when I try to read them. This is the output of l

Re: inout based on this reference?

2010-08-30 Thread Steven Schveighoffer
On Mon, 30 Aug 2010 13:49:20 -0400, Simen kjaeraas wrote: Steven Schveighoffer wrote: 0123456789012345678901234567890123456789012345678901234567890123456789012 On Sun, 29 Aug 2010 17:36:24 -0400, Simen kjaeraas wrote: Is it possible to make a function return dependent upon the constancy

Re: inout based on this reference?

2010-08-30 Thread Simen kjaeraas
Steven Schveighoffer wrote: 0123456789012345678901234567890123456789012345678901234567890123456789012 On Sun, 29 Aug 2010 17:36:24 -0400, Simen kjaeraas wrote: Is it possible to make a function return dependent upon the constancy of the this reference? i.e. this: struct foo { int n;

Re: defect when using 'alias this' in a struct?

2010-08-30 Thread Steven Schveighoffer
On Mon, 30 Aug 2010 13:12:00 -0400, Kieron Brown wrote: I have used alias this and found odd behaviour in complex code. I tracked the problem down and was able to replicate it with a much simpler case as given below. I'm new to D (but have read TDPL). Is this my mis-understanding or a defec

defect when using 'alias this' in a struct?

2010-08-30 Thread Kieron Brown
I have used alias this and found odd behaviour in complex code. I tracked the problem down and was able to replicate it with a much simpler case as given below. I'm new to D (but have read TDPL). Is this my mis-understanding or a defect? Many thanks, Kieron - self contained d sample starts

Re: inout based on this reference?

2010-08-30 Thread Steven Schveighoffer
On Sun, 29 Aug 2010 17:36:24 -0400, Simen kjaeraas wrote: Is it possible to make a function return dependent upon the constancy of the this reference? i.e. this: struct foo { int n; inout( ref int ) getn( ) inout { return n; } } Yes. That is the bread-and-butter usa

Re: inout based on this reference?

2010-08-30 Thread Steven Schveighoffer
On Mon, 30 Aug 2010 09:08:11 -0400, Steven Schveighoffer wrote: On Sun, 29 Aug 2010 17:36:24 -0400, Simen kjaeraas wrote: Is it possible to make a function return dependent upon the constancy of the this reference? i.e. this: struct foo { int n; inout( ref int ) getn( ) inout

Re: void[] vs byte[]

2010-08-30 Thread Steven Schveighoffer
On Sat, 28 Aug 2010 16:13:28 -0400, BCS wrote: Hello Yao G., I'm here with another n00b question: When dealing with big buffers (or files), which is better to use as storage? void[] or byte[]? If the data may contain pointers into the heap, use void[] if it will not use byte[]. byte[] is

Re: Problems with receive

2010-08-30 Thread Stanislav Blinov
30.08.2010 3:06, SK wrote: On Sun, Aug 29, 2010 at 10:45 AM, Bob Cowdery > wrote: Error: static assert "function with arguments (VariantN!(maxSize)) occludes successive function" But there is no successive function, its the last statement. I enco

Re: msg[0] or msg.field[0] ?

2010-08-30 Thread SK
On Sun, Aug 29, 2010 at 10:47 AM, bearophile wrote: > SK: > > What is the explanation? > > The syntax shown in TDPL can't be supported yet, because the DMD compiler > doesn't yet allow it. It will be added. In the meantime you have to use the > .field[] syntax, or the "secret" ._0 ._1 ecc syntax.

Re: Problems with receive

2010-08-30 Thread SK
On Sun, Aug 29, 2010 at 10:45 AM, Bob Cowdery wrote: > > Error: static assert "function with arguments (VariantN!(maxSize)) > occludes successive function" > But there is no successive function, its the last statement. > > I encountered this one too and it appears to be a regression in 2.048 that