Is there a reason to prefer one of these approaches over the other?
Maybe one is more efficient and should be preferred if doing a large number of appends.

Approach #1

s := ''.
s := s, 'foo'.
s := s, 'bar'

Approach #2

stream := WriteStream on: ''.
stream nextPutAll: 'foo'.
stream nextPutAll: 'bar'.
s := stream contents

Are there other approaches I should consider?

---
Mark Volkmann




_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to