digitalmars.D.bugs - String array concantenation irregularities.
- AJG (17/17) Sep 18 2005 Hi there,
- =?ISO-8859-1?Q?Thomas_K=FChne?= (17/39) Sep 19 2005 -----BEGIN PGP SIGNED MESSAGE-----
- AJG (3/20) Sep 19 2005 Great, thanks.
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.
Sep 18 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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 -----BEGIN PGP SIGNATURE----- iD8DBQFDLmgO3w+/yD4P9tIRAvb0AKDD65q+Y7XEUNI1anp5cGmScE9oyQCfXLqH r5A+mcvmeVzxhVbfN2dhK7o= =nATo -----END PGP SIGNATURE-----
Sep 19 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.
Sep 19 2005