[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Dec 20 11:57:02 2001 
Subject:Re: Have I hit a bug already? 
From:Stephen Isard 
Volume-ID:1011220.11 

Pete Goodeve wrote:

>         str<>s->str;

When str starts off as the empty string, this is effectively the
same as
s->str;
i.e., you are making making the variable str point to the same thing
that the variable s points to.  Then when you assign to s the next time,
you are assigning to str as well.

Concatenation with the empty string isn't creating a new string, as you
might assume.   It isn't a bug in the implementation, but you might find
the design decision unintuitive coming from some other languages (many
of which probably didn't yet exist when the decision was taken).

Regards,

Stephen Isard