[Pharo-users] Stream >> <<

Noury Bouraqadi bouraqadi at gmail.com
Tue Sep 10 08:51:12 EDT 2019


Herby,

It's a feature. ;-)

<< sends putOn: message to the non-collection args.
Integer>>#putOn: aStream
	aStream isBinary
		ifTrue: [ self asByteArray do: [ :each | aStream nextPut: each ] ]
		ifFalse: [ self asString putOn: aStream ]

String>>#putOn: aStream
	aStream nextPutAll: self

> On 10 Sep 2019, at 11:27, Herby Vojčík <herby at mailbox.sk> wrote:
> 
> Hello!
> 
> In Pharo 7.0.4,
> 
>  Array streamContents: [ :s | s << 10 << '10' << #(10 '10') ]
> 
>  >>> #($1 $0 $1 $0 10 '10')
> 
> Bug or feature?
> 
> Herby
> 




More information about the Pharo-users mailing list