www.digitalmars.com         C & C++   DMDScript  

D - cat & catass operator

reply "Nicolas Repiquet" <deadcow-remove-this free.fr> writes:
Hi folks,

Im trying to understand why this works :

char[] foo;
foo ~= "fo";
foo ~= 'o';

and why this dont :

char[] foo;
foo = foo ~ "fo";
foo = foo ~ 'o'; // <- error here

They are supposed to do the same thing aren't they ?


-- Nicolas Repiquet
Sep 22 2003
next sibling parent reply "DrakeX" <kb3ctd2 yahoo.com> writes:
does putting double quotes around the o help?  like

char[] foo;
foo = foo ~ "fo";
foo = foo ~ "o";
Sep 22 2003
parent "Nicolas Repiquet" <deadcow-remove-this free.fr> writes:
"DrakeX" <kb3ctd2 yahoo.com> a écrit dans le message news:
bko2ar$gsv$1 digitaldaemon.com...
 does putting double quotes around the o help?  like

 char[] foo;
 foo = foo ~ "fo";
 foo = foo ~ "o";
Yes it works, but my message was not an "how to do it" message, I just wanna point out a strange behaviour. Thank you for your help anyway. -- Nicolas Repiquet
Sep 23 2003
prev sibling parent "Walter" <walter digitalmars.com> writes:
"Nicolas Repiquet" <deadcow-remove-this free.fr> wrote in message
news:bkmgar$dnt$1 digitaldaemon.com...
 Hi folks,

 Im trying to understand why this works :

 char[] foo;
 foo ~= "fo";
 foo ~= 'o';

 and why this dont :

 char[] foo;
 foo = foo ~ "fo";
 foo = foo ~ 'o'; // <- error here

 They are supposed to do the same thing aren't they ?
It's supposed to do the same thing, it's a bug that it doesn't. -Walter
Sep 28 2003