In article <3C21D20E.2FFC@ed.ac.uk>,
Stephen Isard <S.IsardDeleteThis@ed.ac.uk> 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).
Ahh. Yes. I suspect this is the sort of thing that is going to trip
me up a few times more! (:-))
As I think about it, I'm not sure yet how to do what I wanted to.
I may post some more questions on this topic...
-- Pete --
|