[squeak-dev] The Trunk: KernelTests-nice.244.mcz

Louis LaBrunda Lou at Keystone-Software.com
Mon Feb 25 15:08:38 UTC 2013


I extended WriteStream in VA Smalltalk with:

onStringOfSize: anInt
	"Answer a new instance to write stream on a string of size anInt."

	^self on: (String new: anInt).

so that when I know I need a large stream, I can give it a good starting
size.

I do kind of like extending String with writeStream (thinking about it) so
one could write:

	(String new: anInt) writeStream

Lou


On Sat, 23 Feb 2013 22:25:39 -0800, tim Rowledge <tim at rowledge.org> wrote:

>
>On 23-02-2013, at 5:34 PM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>
>> On Sat, Feb 23, 2013 at 4:08 PM, Bob Arning <arning315 at comcast.net> wrote:
>>> I tried it and did not see a problem. That is an empty string, isn't it?
>> 
>> Yes, and you're getting away with it because the WriteStream
>> implementation doesn't use become: to grow strings.  But back in the
>> day it did and would have resulted in a non-zero string.
>
>
>If Eliot's explanation doesn't convince you, just consider how ugly an expression it is. Let's have "WriteStream onNewString". Much more readable. Clearly expressed intent.
>
>tim
-----------------------------------------------------------
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou at Keystone-Software.com http://www.Keystone-Software.com



More information about the Squeak-dev mailing list