digitalmars.D.bugs - concat bug?
- Nick (23/23) Jun 21 2005 Is this intended behaviour?
- Derek Parnell (7/34) Jun 21 2005 I'm sure this is a bug. Replace "str = str ~ c;" with "str ~= c;" and it
- Thomas Kuehne (31/54) Jun 22 2005 -----BEGIN PGP SIGNED MESSAGE-----
Is this intended behaviour? Output: a b In other words, 'str ~ c' when str is empty results in a 'slice' of the character c. If it IS intended, I don't think it should be, because it probably isn't what the programmer intended (in my case 'c' was the loop variable in a foreach loop, and this bug was NOT easy to find, believe me...) It's also inconsistent with the behaviour of str ~= c in the same situation. Nick
Jun 21 2005
On Tue, 21 Jun 2005 17:16:33 +0000 (UTC), Nick wrote:Is this intended behaviour? Output: a b In other words, 'str ~ c' when str is empty results in a 'slice' of the character c. If it IS intended, I don't think it should be, because it probably isn't what the programmer intended (in my case 'c' was the loop variable in a foreach loop, and this bug was NOT easy to find, believe me...) It's also inconsistent with the behaviour of str ~= c in the same situation. NickI'm sure this is a bug. Replace "str = str ~ c;" with "str ~= c;" and it works as expected. -- Derek Melbourne, Australia 22/06/2005 10:05:04 AM
Jun 21 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Nick schrieb am Tue, 21 Jun 2005 17:16:33 +0000 (UTC):Is this intended behaviour? Output: a b In other words, 'str ~ c' when str is empty results in a 'slice' of the character c. If it IS intended, I don't think it should be, because it probably isn't what the programmer intended (in my case 'c' was the loop variable in a foreach loop, and this bug was NOT easy to find, believe me...) It's also inconsistent with the behaviour of str ~= c in the same situation. NickAdded to DStress as http://dstress.kuehne.cn/run/o/opCat_15_A.d http://dstress.kuehne.cn/run/o/opCat_15_B.d http://dstress.kuehne.cn/run/o/opCat_15_C.d http://dstress.kuehne.cn/run/o/opCat_15_D.d http://dstress.kuehne.cn/run/o/opCat_15_E.d http://dstress.kuehne.cn/run/o/opCat_15_F.d http://dstress.kuehne.cn/run/o/opCat_15_G.d http://dstress.kuehne.cn/run/o/opCat_15_H.d http://dstress.kuehne.cn/run/o/opCat_15_I.d http://dstress.kuehne.cn/run/o/opCat_15_J.d http://dstress.kuehne.cn/run/o/opCat_15_K.d http://dstress.kuehne.cn/run/o/opCat_15_L.d http://dstress.kuehne.cn/run/o/opCat_15_M.d http://dstress.kuehne.cn/run/o/opCat_15_N.d http://dstress.kuehne.cn/run/o/opCat_15_O.d http://dstress.kuehne.cn/run/o/opCat_15_P.d http://dstress.kuehne.cn/run/o/opCat_15_Q.d http://dstress.kuehne.cn/run/o/opCat_15_R.d http://dstress.kuehne.cn/run/o/opCat_15_S.d http://dstress.kuehne.cn/run/o/opCat_15_T.d http://dstress.kuehne.cn/run/o/opCat_15_U.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCuU2n3w+/yD4P9tIRAhJmAJ9Uc3xG8fDEaiJd35BaXZvLzWzm4QCggEOV tu8XP5PVZvWHyEuMAGmqsVc= =ymTe -----END PGP SIGNATURE-----
Jun 22 2005