2015-07-29 20:09 GMT-03:00 Eliot Miranda <eliot.miranda@gmail.com>:


On Sat, Jul 25, 2015 at 9:39 AM, Hern��n Morales Durand <hernan.morales@gmail.com> wrote:
In BioSmalltalk I use this pattern a lot:

������ aStream
������ ������ nextPutAll: self name
������ ������ between: $[ -> $].

so yes, that would be a nice inclusion for me :)

i don't like the allocation here; v slow. ��why not nextPutAll:between:and: ?

Because I wasn't very inspired :)

Thanks!

Hern��n

��
��

Cheers,

Hern��n




2015-07-24 17:48 GMT-03:00 stepharo <stepharo@free.fr>:
HI

while working on a lecture I saw that we have about 75 cases like:

�� �� �� �� �� �� aStream nextPut: $(.
�� �� �� �� �� �� �� �� ....
�� �� �� �� �� �� aStream nextPut: $).



�� �� storeOn: aStream
�� �� "Store a description of the elements of the complement rather than self."

�� �� �� �� aStream nextPut: $(.
�� �� �� �� absent storeOn: aStream.
�� �� �� �� aStream nextPut: $); space; nextPutAll: #complement.


printElementsOn: aStream
�� �� aStream nextPut: $(.
�� �� self size > 100
�� �� �� �� ifTrue: [aStream nextPutAll: 'size '.
�� �� �� �� �� �� self size printOn: aStream]
�� �� �� �� ifFalse: [self keysSortedSafely
�� �� �� �� �� �� �� �� do: [:key | aStream print: key;
�� �� �� �� �� �� �� �� �� �� �� �� ��nextPutAll: '->';
�� �� �� �� �� �� �� �� �� �� �� �� ��print: (self at: key);
�� �� �� �� �� �� �� �� �� �� �� �� ��space]].
�� �� aStream nextPut: $)

we have surroundedBy: aString

surroundedBy: aString
�� �� ^ self class streamContents: [ :s|
�� �� �� �� s nextPutAll: aString.
�� �� �� �� s nextPutAll: self.
�� �� �� �� s nextPutAll: aString ].

But only working on aString.
To me it looks like it ia class for having it on stream.

What do you think?








--
_,,,^..^,,,_
best,��Eliot