"Claus" == Claus Kick claus_kick@web.de writes:
Claus> YourClass >> escape: aString
Claus> "escapes a String"
Claus> |result|
Claus> result := ''. Claus> aString do:[:char | result := result, char xmlEscaped]. Claus> ^result
This is an expensive way to build a string. #collect: would be better:
aString collect: [:char | char xmlEscaped].
Internally, that uses a Stream, which extends itself nicely as new data appears. In your version, the early string data is getting repeatedly copied to make each new string. Ouch.