Hi doru

may be I do not see the obvious.
I defined a class

Object subclass: #MFElement
    instanceVariableNames: 'name parent'
    classVariableNames: ''
    package: 'MyFS2'

printOn: aStream
    parent isNil ifFalse: [ parent printOn: aStream ].
    aStream << name

name: aString
     name := aString


MFDirectory new name: 'comics'.


And when I do


(MFDirectory new name: 'comics')
comics/


(MFDirectory new name: 'comics') printString
'comics/'



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 <stephar...@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."




--
Using Opera's mail client: http://www.opera.com/mail/

Attachment: MFElement.st
Description: Binary data

Reply via email to