Thread overview
String array concantenation irregularities.
Sep 18, 2005
AJG
Sep 19, 2005
Thomas Kühne
Sep 20, 2005
AJG
September 18, 2005
Hi there,

The good:

void main() {
    const static int[] ints = [42];
    const static int test = 13;
    (ints ~ test).length; // Correct: length == 2
    (ints ~   13).length; // Correct: length == 2
}

The bad: Now, if we use strings instead of ints:

void main() {
    const static string[] strings = ["Foo"];
    const static string test = "Bar";
    (strings ~  test).length; // BUG1: Length == 4 ??
    (strings ~ "Bar").length; // BUG2: Won't even compile ??
}

Thoughts?
--AJG.
September 19, 2005
AJG schrieb:
> Hi there,
> 
> The good:
> 
> void main() {
>     const static int[] ints = [42];
>     const static int test = 13;
>     (ints ~ test).length; // Correct: length == 2
>     (ints ~   13).length; // Correct: length == 2
> }
> 
> The bad: Now, if we use strings instead of ints:
> 
> void main() {
>     const static string[] strings = ["Foo"];
>     const static string test = "Bar";
>     (strings ~  test).length; // BUG1: Length == 4 ??
>     (strings ~ "Bar").length; // BUG2: Won't even compile ??
> }
> 
> Thoughts?
> --AJG.

Added to DStress as http://dstress.kuehne.cn/run/o/opCat_16_A.d http://dstress.kuehne.cn/run/o/opCat_16_B.d http://dstress.kuehne.cn/run/o/opCat_16_C.d http://dstress.kuehne.cn/run/o/opCat_16_D.d http://dstress.kuehne.cn/run/o/opCat_16_E.d http://dstress.kuehne.cn/run/o/opCat_16_G.d http://dstress.kuehne.cn/run/o/opCat_16_H.d

Thomas
September 20, 2005
Thomas Kühne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Added to DStress as
> http://dstress.kuehne.cn/run/o/opCat_16_A.d
> http://dstress.kuehne.cn/run/o/opCat_16_B.d
> http://dstress.kuehne.cn/run/o/opCat_16_C.d
> http://dstress.kuehne.cn/run/o/opCat_16_D.d
> http://dstress.kuehne.cn/run/o/opCat_16_E.d
> http://dstress.kuehne.cn/run/o/opCat_16_G.d
> http://dstress.kuehne.cn/run/o/opCat_16_H.d
> 
> Thomas
> -----BEGIN PGP SIGNATURE-----
> 
> iD8DBQFDLmgO3w+/yD4P9tIRAvb0AKDD65q+Y7XEUNI1anp5cGmScE9oyQCfXLqH
> r5A+mcvmeVzxhVbfN2dhK7o=
> =nATo
> -----END PGP SIGNATURE-----

Great, thanks.
--AJG.