[Pharo-dev] confused about printString and printIt

Tudor Girba tudor at tudorgirba.com
Sun Feb 19 00:48:53 EST 2017


Hi Stef,

I think I do not understand the issue.

Here is the screenshot of a Playground.

‘comics’ -> print-it -> ‘comics'



What am I missing?

Cheers,
Doru


> On Feb 18, 2017, at 6:26 PM, stepharong <stepharong at free.fr> wrote:
> 
> 
> Hi guys
> 
> I'm working on an introduction chapter for my future book and I do not like the behavior I see in latest pharo 60.
> 
> And I do not understand the behavior of print-it
> 
> (MFDirectory new name: 'comics')
> comics/
> 
> 
> (MFDirectory new name: 'comics') printString
>>>> 'comics/'
> 
> 
> Why print it does not produce ''?
> 
> 
> Stef
> 
> 
> printIt
> 	"Treat the current text selection as an expression; evaluate it. Insert the
> 	description of the result of evaluation after the selection and then make
> 	this description the new text selection."
> 
> 	| printString |
> 	self
> 		evaluateSelectionAndDo: [ :result |
> 			printString := [ result printString ]
> 				on: Error
> 				do: [ '<error in printString: try ''Inspect it'' to debug>' ].
> 			self afterSelectionInsertAndSelect: printString ]
> 
> 
> 
> 
> -- 
> Using Opera's mail client: http://www.opera.com/mail/
> 

--
www.tudorgirba.com
www.feenk.com

"It's not how it is, it is how we see it."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20170219/f82a41e2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-02-19 at 6.47.17 AM.png
Type: image/png
Size: 47090 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20170219/f82a41e2/attachment.png>


More information about the Pharo-dev mailing list