Hi, Well, If there wouldn't be already a way to do it, I wouldn't care which one to take. But this is not the case: we are discussing the introduction of a new vocabulary when there is already another who is fulfilling the place. In that sense, the proposed method solves a problem who is actually not there. If we do not like #<<, then we should remove it from system, but please, let's not add a more limited method when we have a more generic one who does the job... I repeat: we are not discussing the introduction of one or another method, but the introduction of one who overlaps another who is already there. Cheers, Esteban Ps: I will be back next thursday... I can discuss more then...
On 26 Jul 2015, at 17:22, stepharo <stepharo@free.fr> wrote:
I like the solution of hernan better. I think that surrounding is a common pattern.
Stef
Le 25/7/15 22:02, Max Leske a écrit :
On 25 Jul 2015, at 21:31, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 25 Jul 2015, at 19:40, Esteban Lorenzano <estebanlm@gmail.com> wrote:
(From my vacations)
Doesn't this solves the problem?
stream << $( << name << $)
It is already there :) Yes, indeed:
String streamContents: [ :out | out <<$( << 'test-' << 123 << $) ]
(But it is not perfect, there is still confusion there) I agree. Iâve never liked that operator. Apart from #// and #\\ there are pretty much no selectors that make you guess their meaning. The meaning is in all other cases transported through wording, which I feel very comfortable with. Yes, itâs convenient to write but, as Sven points out, I actually find it less readable. I like Hernanâs idea better.
We are trying to reduce the String and Stream API, so any addition should be really important/significant.
Now I comeback to watch the see...
On 25 Jul 2015, at 18:39, 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 :)
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?