Re: Bug or feature?

2013-05-27 Thread mimi
Well, how you can reduce the long ugly name in this case? In the real function I mentioned it so many times.

Re: Bug or feature?

2013-05-27 Thread Namespace
void foo( S s ) { auto local = this.bigUglyName; auto b = s.bigUglyName; writeln( bigUglyName (AKA local)=, local, b=, b ); } :P

Re: Bug or feature?

2013-05-27 Thread mimi
On Monday, 27 May 2013 at 10:17:01 UTC, Namespace wrote: void foo( S s ) { auto local = this.bigUglyName; auto b = s.bigUglyName; writeln( bigUglyName (AKA local)=, local, b=, b ); } :P By the way, yes. Thanks for that, I'm stupid today.

Re: Bug or feature?

2013-05-27 Thread Maxim Fomin
On Monday, 27 May 2013 at 10:07:49 UTC, mimi wrote: Well, how you can reduce the long ugly name in this case? In the real function I mentioned it so many times. By not making the name ugly big.

Re: Passing large or complex data structures to threads

2013-05-27 Thread Joseph Rushton Wakeling
On 05/26/2013 05:59 PM, Ali Çehreli wrote: On 05/26/2013 05:38 AM, Simen Kjaeraas wrote: Tuple!(size_t, size_t)[][] data = createData(); immutable dataImm = assumeUnique(data); data = null; // Simply to ensure no mutable references exist. The last line is not needed.

Accepting delegates/functions in templates

2013-05-27 Thread Luís.Marques
I'm trying to accept delegates or functions in a templated method. My first try using isDelegate!dg || isFunctionPointer!dg did not work because isDelegate fails, although I'm not sure I understand exactly why: void main() { int x; static assert(isDelegate!(() { x =

Re: Accepting delegates/functions in templates

2013-05-27 Thread Ali Çehreli
On 05/27/2013 07:05 AM, Luís Marques luismarq...@gmail.com wrote: If I changed that example to use isSomeFunction it works correctly. But when I tried to use isSomeFunction in the proper context it fails to compile: It is a red herring. The code fails to compile even without isSomeFunction.

Two questions about assignments

2013-05-27 Thread bearophile
Do you know if it's OK to accept x3 assignment and refuse the a2 assignment? struct Foo { immutable(char)[4] bar; } Foo x1 = { AA };// No error. immutable(char)[4] a1 = AA; // No error. void main() { Foo x2 = { AA };// No error. Foo x3 = Foo(AA); // No

Re: Any examples of using inotify with D?

2013-05-27 Thread Gary Willoughby
On Saturday, 25 May 2013 at 21:19:30 UTC, Gary Willoughby wrote: Is there any examples of using inotify with D? http://en.wikipedia.org/wiki/Inotify I've updated the old tango header file and tried to get something working but it seems to hang. If anyone else has code using inotify i'd love

How do you guys debug large programs?

2013-05-27 Thread Gary Willoughby
This is quite an open ended question but i wondered how you guys debug your D programs (i'm talking about stepping through code, setting breakpoints, etc). The lack of nice IDE's with integrated debuggers is worrying when working with D but up until now i haven't need one. Now i've started

Re: How do you guys debug large programs?

2013-05-27 Thread mimi
On Monday, 27 May 2013 at 19:55:57 UTC, Gary Willoughby wrote: This is quite an open ended question but i wondered how you guys debug your D programs (i'm talking about stepping through code, setting breakpoints, etc). The lack of nice IDE's with integrated debuggers is worrying when working

Re: Bug or feature?

2013-05-27 Thread mimi
On Monday, 27 May 2013 at 11:32:46 UTC, Maxim Fomin wrote: On Monday, 27 May 2013 at 10:07:49 UTC, mimi wrote: Well, how you can reduce the long ugly name in this case? In the real function I mentioned it so many times. By not making the name ugly big. Other people do. In addition,

Re: Passing large or complex data structures to threads

2013-05-27 Thread Simen Kjaeraas
On Mon, 27 May 2013 14:08:12 +0200, Joseph Rushton Wakeling joseph.wakel...@webdrake.net wrote: On 05/26/2013 05:59 PM, Ali Çehreli wrote: On 05/26/2013 05:38 AM, Simen Kjaeraas wrote: Tuple!(size_t, size_t)[][] data = createData(); immutable dataImm = assumeUnique(data);

Re: Two questions about assignments

2013-05-27 Thread Kenji Hara
On Monday, 27 May 2013 at 18:00:38 UTC, bearophile wrote: Do you know if it's OK to accept x3 assignment and refuse the a2 assignment? struct Foo { immutable(char)[4] bar; } Foo x1 = { AA };// No error. immutable(char)[4] a1 = AA; // No error. void main() { Foo x2 = { AA

Immutability vs reference types

2013-05-27 Thread Francois Chabot
Hello, I'm trying to get back into D again. This time around, I'm playing mostly with concurency and parallism, all the while trying to get my code writen in the D way as much as possible. I've run into a rather major road block that seems rather nonsensical at face value, so I'm not sure if i'm

Re: Two questions about assignments

2013-05-27 Thread bearophile
Kenji Hara: Thank you very much for your gentle and useful answers :-) struct Foo { immutable(char)[4] bar; } Foo x1 = { AA };// No error. immutable(char)[4] a1 = AA; // No error. void main() { Foo x2 = { AA };// No error. Foo x3 = Foo(AA); // No error.

Re: Immutability vs reference types

2013-05-27 Thread Diggory
On Tuesday, 28 May 2013 at 00:24:32 UTC, Francois Chabot wrote: Hello, I'm trying to get back into D again. This time around, I'm playing mostly with concurency and parallism, all the while trying to get my code writen in the D way as much as possible. I've run into a rather major road block

Re: Immutability vs reference types

2013-05-27 Thread Francois Chabot
On Tuesday, 28 May 2013 at 00:35:32 UTC, Diggory wrote: On Tuesday, 28 May 2013 at 00:24:32 UTC, Francois Chabot wrote: Hello, I'm trying to get back into D again. This time around, I'm playing mostly with concurency and parallism, all the while trying to get my code writen in the D way as

Re: How do you guys debug large programs?

2013-05-27 Thread Adam D. Ruppe
On Monday, 27 May 2013 at 19:55:57 UTC, Gary Willoughby wrote: Now i've started to write much larger programs, i'm wondering which debuggers do you use? Especially using Linux. I just use gdb with dmd's -gc -debug flags, when I use a debugger at all. tbh I kinda prefer just littering

Re: Two questions about assignments

2013-05-27 Thread Kenji Hara
On Tuesday, 28 May 2013 at 00:29:04 UTC, bearophile wrote: std.typecons.Tuple supports structural assignment before the change. The code also works with 2.062. I know it's not a regression. But you say: Named-field tuple should be a subtype of unnamed-field tuple. You can have sub-typing, or

Re: Passing large or complex data structures to threads

2013-05-27 Thread Joseph Rushton Wakeling
On 05/27/2013 11:33 PM, Simen Kjaeraas wrote: A few questions: Why use a class? Will MyDataStore be subclassed? It was important to me that it have reference semantics, in particular that a = b implies a is b. Will you have some instances of MyDataStore that will be mutated, and others