which version of D for beginers?

2008-11-21 Thread Fei
Hi, I'm a new D learner but I'm wondering which version of D is suitable for me. v1, or v2? When D 2 is out, it seems to be apparent that I should go directly to v2. But my intention of using D is to create small desktop application for windows, which needs GUI library of cource. I checked out

Re: Compilation error when using a extern function ?

2008-11-21 Thread tsalm
Le Fri, 21 Nov 2008 00:34:03 +0100, Denis Koroskin <[EMAIL PROTECTED]> a écrit: union ColorProxy { uint color; struct { ubyte red; ubyte green; ubyte blue; ubyte alpha; } } ColorProxy proxy; proxy.color = ColorValues.Aqua; return Color(proxy.red, proxy.gre

Re: how to use opdot

2008-11-21 Thread Steven Schveighoffer
"Ary Borenszweig" wrote > Christopher Wright escribió: >> Steven Schveighoffer wrote: >>> "Christopher Wright" wrote Steven Schveighoffer wrote: > Not exactly ;) The wrapped type is not equivalent to inheritance. No, exactly: class Wrapper(T) : T { T opDot() {} >>

Re: how to use opdot

2008-11-21 Thread Ary Borenszweig
Christopher Wright escribió: Steven Schveighoffer wrote: "Christopher Wright" wrote Steven Schveighoffer wrote: Not exactly ;) The wrapped type is not equivalent to inheritance. No, exactly: class Wrapper(T) : T { T opDot() {} } class Wrapper(T) : T { } works just as good ;) -Steve T

Re: Save/load data to a file (JSON for phobos)

2008-11-21 Thread Niels
struct A { char[] sval = "test"; bool bval = true; int ival = 3; double dval = 4f/3; real rval = 8f/3; } should likely be: struct A { char[] sval = "test"; bool bval = true; int ival = 3; double dval = 4f/3f; // 4/3f should work to real rval = 8f/3f; }

Re: Descent project file organization

2008-11-21 Thread Ary Borenszweig
Bill Baxter escribió: On Fri, Nov 21, 2008 at 10:59 AM, Ary Borenszweig <[EMAIL PROTECTED]> wrote: If you don't want to move your files and keep them where they are, create a new D project and in the first page of the wizard select "from existing source" and type or select the folder where your

Re: access subclass functions

2008-11-21 Thread Saaa
You mean something like this ? struct fruits { Banana banana(); Apple apple(); } I now use foreach(int i, Fruit fruit; fruits) a lot. How do I iterate over all elements when I use the above? > Saaa Wrote: > >> >> this wrong: >> >> fruits[BANANA].peel(); >> > >> > why not using struct? >

Re: access subclass functions

2008-11-21 Thread Kagamin
Saaa Wrote: > >> this wrong: > >> fruits[BANANA].peel(); > > > > why not using struct? > > How do you mean? > What should be a struct? > typed array.