Is there any way to fix this elegant way to walk a tree at compile time?

2011-01-17 Thread Gareth Charnock
I was trying to walk a tree at compile time and I came up with this method. It seems very elegant, but unfortunately it fails with a recursive alias declaration error. I have a bad feeling there's no way to fix this but I thought I'd ask in case anyone had any ideas.

Re: A CTFE Segfault (with explanation, but I'm not sure what the fix

2010-12-08 Thread Gareth Charnock
On 21/11/10 22:39, bearophile wrote: Gareth Charnock: struct LeafType { string Compile_not_ovloaded() { return expression; } }; Note that D structs don't require the ending semicolon, so in practice it is not used. And in D method names start with a lower

A CTFE Segfault (with explanation, but I'm not sure what the fix is).

2010-11-21 Thread Gareth Charnock
This code makes the DMD compiler segfault struct LeafType { string Compile_not_ovloaded() { return expression; } }; struct MatrixASTNode { LeafType Right; string Compile() { return Right.Compile_not_ovloaded(); } }; void

Re: cannot evalute mixin(uuid(bla)) at compile time

2010-08-03 Thread Gareth Charnock
On 03/08/10 15:19, Sam Hu wrote: Base on D1: interface IADsPropertyEntry : IDispatch { mixin(uuid(05792c8e-941f-11d0-8529-00c04fd8d503)); ... Error when compile: argument to mixin must be a string,not mixin(uuid(05792c8e-941f-11d0-8529-00c04fd8d503)) cannot evaluate

Overzealous immutable and classes

2010-07-15 Thread Gareth Charnock
So having got a collectors' edition TDPL, I though I'd have a try at writing some concurrent code. The idea was a worker thread(s) would do some work and write the results to some immutable objects. These would get passed to an indexer thread that would do neat stuff like indexing the

Re: Is the memory address of classinfo the same for all instances of a class?

2010-07-15 Thread Gareth Charnock
On 02/07/10 15:18, Heywood Floyd wrote: On Jul 2, 2010, at 15:34 , Steven Schveighoffer wrote: On Fri, 02 Jul 2010 09:32:39 -0400, Steven Schveighofferschvei...@yahoo.com wrote: On Fri, 02 Jul 2010 09:24:20 -0400, Heywood Floydsoul...@gmail.com wrote: Good day! Consider // - - - -

Re: Overzealous immutable and classes

2010-07-15 Thread Gareth Charnock
On 16/07/10 02:08, Jonathan M Davis wrote: On Thursday, July 15, 2010 17:40:26 Gareth Charnock wrote: So having got a collectors' edition TDPL, I though I'd have a try at writing some concurrent code. The idea was a worker thread(s) would do some work and write the results to some immutable

rt_attachDisposeEvent: the apparent magic behind std.signals

2010-01-26 Thread Gareth Charnock
I was looking at the std.signals code in svn to find out how the magic of the observer class not needing to inherit anything was done and I was somewhat disappointed to see rt_attachDisposeEvent. Is this function standardised or exposed anywhere? I can think of cases where being able to listen

Re: TLS definition in curses.o section .tbss mismatches non-TLS reference in /usr/lib/libncurses.a(lib_initscr.o)

2009-12-11 Thread Gareth Charnock
Bernard Helyer wrote: On 11/12/09 10:48, Gareth Charnock wrote: Is there any way to tell dmd to just share them between threads? __gshared type whatever; Thanks. And now I see there was an article about that on website all along. I guess my eyes must have just scanned over it. A good

TLS definition in curses.o section .tbss mismatches non-TLS reference in /usr/lib/libncurses.a(lib_initscr.o)

2009-12-10 Thread Gareth Charnock
I've been trying to link a d program to a c library (ncurses in this case) on ubuntu 9.10 with dmd v2.036. Converting curses.c to a .d header seemed to go okay when I try to link the files together I get this: dmd -c main.d dmd -c curses.d dmd main.o curses.o -L/usr/lib/libncurses.a