Proposal for enhancing Transcript show:
Norton, Chris
chrisn at Kronos.com
Sun Feb 13 07:36:36 UTC 2000
Hi Stefan & friends.
On 2/12/00, Stefan Aust wrote:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"I always wondered why Transcript show: only accepts strings as arguments."
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
While I'm not opposed to bullet-proofing Transcript show:, I do think that
your proposed code change is, ahem, a bit heavy handed (sorry if I'm less
than polite, it's _quite_ late on the US east coast :-).
In particular, I would recommend avoiding the isKindOf: call. I have been
told in the past that it is a bit expensive. And, of course, polymorphism
makes the asString method very inexpensive (String>>asString simply returns
self).
Thus, something like this would probably be cleaner (& quicker):
TranscriptStream>>
show: aString "TextCollector compatibility"
self nextPutAll: aString asString.
self endEntry
Cheers & good evening!
---==> Chris
More information about the Squeak-dev
mailing list
|