Re: Compile time static array issues.

2011-05-29 Thread Andrej Mitrovic
On 5/29/11, bearophile wrote: > Andrej Mitrovic: > >> C struct initialization in D is also buggy, it doesn't take into >> account field initializers. It's best to get used to the D way of >> initializing structs. > > I'd like it to be debugged instead :-) Well if it has already been decided that

Re: Compile time static array issues.

2011-05-29 Thread bearophile
Andrej Mitrovic: > C struct initialization in D is also buggy, it doesn't take into > account field initializers. It's best to get used to the D way of > initializing structs. I'd like it to be debugged instead :-) Bye, bearophile

Re: Compile time static array issues.

2011-05-29 Thread Andrej Mitrovic
C struct initialization in D is also buggy, it doesn't take into account field initializers. It's best to get used to the D way of initializing structs.

Re: Compile time static array issues.

2011-05-29 Thread Jacob Carlborg
On 2011-05-29 15:01, bearophile wrote: Jacob Carlborg: Isn't that struct initialization syntax deprecated or to be deprecated? You may be right. Sometimes I read about deprecations, and then after a while I forget it because the alternative (like using the complex numbers of Phobos) is too

Re: Compile time static array issues.

2011-05-29 Thread bearophile
Jacob Carlborg: > Isn't that struct initialization syntax deprecated or to be deprecated? You may be right. Sometimes I read about deprecations, and then after a while I forget it because the alternative (like using the complex numbers of Phobos) is too much ugly by comparison :-) I think we n

Re: Compile time static array issues.

2011-05-29 Thread Jacob Carlborg
On 2011-05-29 03:56, bearophile wrote: Era Scarecrow: I don't seem to have a good explanation why this isn't working. Also try: struct Joined { string name, partof, preReq; } struct SubrecordParts { string name; int size; string[] notes; int identifyBy; int[]

Re: Compile time static array issues.

2011-05-29 Thread Era Scarecrow
== Quote from bearophile (bearophileh...@lycos.com)'s article > Also try: > struct Joined { > string name, partof, preReq; > } > Joined[] attached = [ > {"MAST", "DATA", "TES3"}, > {"ANAM","INTV", "FACT"} > ]; Coming from C, this is exactly what I first tried. However since I don't r

Re: Compile time static array issues.

2011-05-28 Thread bearophile
Era Scarecrow: > I don't seem to have a good explanation why this isn't working. Also try: struct Joined { string name, partof, preReq; } struct SubrecordParts { string name; int size; string[] notes; int identifyBy; int[] partSize; } Joined[] attached = [ {"MAST",

Re: Compile time static array issues.

2011-05-28 Thread Era Scarecrow
== Quote from Robert Clipsham (rob...@octarineparrot.com)'s article > On 28/05/2011 23:57, Era Scarecrow wrote: > try attached = [joined("MAST", "DATA", "TES3"), joined("ANAM", "INTV", > "FACT")]; > Similar here, parts = [ subrecord_parts("AADT", 16, ["fWeight", > "iValue", "iUses", "fQuality"], -

Re: Compile time static array issues.

2011-05-28 Thread Robert Clipsham
On 28/05/2011 23:57, Era Scarecrow wrote: I don't seem to have a good explanation why this isn't working. All i end up getting is 'Error: cannot implicitly convert expression of type string[][] to joined[]'. I also get 'incompatible types for (("AADT") ? (16)): 'string' and 'int''. I've tr

Compile time static array issues.

2011-05-28 Thread Era Scarecrow
I don't seem to have a good explanation why this isn't working. All i end up getting is 'Error: cannot implicitly convert expression of type string[][] to joined[]'. I also get 'incompatible types for (("AADT") ? (16)): 'string' and 'int''. I've tried it with casts, and full array qualifiers.