Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 3 participants
- 144616 messages
Re: [Pharo-dev] Development dashboard for pharo-project repositories
by Ben Coman
Cool. Thanks Rafael.
cheers -ben
On Sun, Feb 19, 2017 at 8:02 PM, Rafael Luque
<rafael.luque.leiva(a)gmail.com> wrote:
> Hi guys!
>
> I've just created a development analytics dashboard for the pharo-project
> organization at GitHub using Cauldron [1], a proof-of-concept by Bitergia, a
> University spin-off here in Madrid.
>
> You can play with the dashboard at:
> https://cauldron.io/dashboards/pharo-project
>
> I expect you enjoy it and get insights about the Pharo community.
>
> [1] https://cauldron.io/
>
> --
> Rafael Luque
>
>
>
>
>
Feb. 19, 2017
Re: [Pharo-dev] confused about printString and printIt
by Ben Coman
On Sun, Feb 19, 2017 at 1:26 AM, stepharong <stepharong(a)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
> | printString |
> self
> evaluateSelectionAndDo: [ :result |
> printString := [ result printString ]
> on: Error
> do: [ '<error in printString: try ''Inspect
> it'' to debug>' ].
> self afterSelectionInsertAndSelect: printString ]
btw, the code you reference there does not get executed from
Playground. This does...
(GLMGenericAction new)
title: 'Print it';
action: [ :aPresentation | aPresentation printSelection ];
keymap: PharoShortcuts current printItShortcut;
yourself.
from GLMRubricSmalltalkCodePresentation>>executionSelectionActions
which announces GLMPrintSelection
leading to GLMMorphicPharoScriptRenderer>>evaluateAndPopPrintHighlight
GLMPrintPopper
installAlarm: #popupPrint
for: self
GLMMorphicPharoCodeRenderer>>popupPrint
"Evaluates selected code and prints it in a popper"
textMorph textArea editor highlightEvaluateAndDo: [ :result |
textMorph shoutStyler style: textMorph text.
GLMPrintPopper new
openFromRubric: textMorph textArea withResult: result ]
cheers -ben
Feb. 19, 2017
Re: [Pharo-dev] confused about printString and printIt
by stepharong
On Sun, 19 Feb 2017 16:04:31 +0100, stepharong <stepharong(a)free.fr> wrote:
> Hi doru
>
> Yes I know. I did not imply anything.I think that the current status is
> bogus.
> I do not see any scenario that makes printString not returning and
> displaying a string good.
Yes there is one: the self evaluating objects
1 printIt
>>> 1
true printIt
>>> true
true printString printIt
>>> 'true'
now I'm confused because there is something that does not work.
>
> I do not get why'comics' printString should double quote it.to me
> 'comics' printString
>>>>
> 'comics'
>
>
> 'comics' printIt
>>>>
> 'comics'
>
> as well as
> (#AAA asClass new name: 'comics') PrintIt
>
>
> I just to not get what is the benefit not to have in the workspace or
> any users of printIt no single quote
>
>
> I agree that for a list of items
> you do not want to have
> 'astroboy' 'tintin'
>
> but instead astroboy
> tintin
>
> I see that lot of people got confused about that. Just look at the
> cuboid videos of Roassal you get comboboxes full of ' ' while there
> should not have any.
> Now to me this is the job of displayString.
> displayString is not the same as printString.
> printString should return a string and I should see a string in the REPL
>
> Currently in the REPL because this is what we are talking aboutobtaining
> a non string is confusing.
> Am I clear?
> Stef
>
>> Hi Stef,
>>
>> Just a clarification. I do not argue here. I just explain what I see. I
>> think it was like this since a long time. I even checked in an old VW I
>> have around and it seems to have the same behavior.
>>
>> But, I do agree that it is not straightforward at all. It took me a
>> while to figure this out and it is still confusing sometimes. In fact,
>> this is why we have a String presentation in the String object - I
>> >>needed something that clarifies situations like these. That does not
>> mean it is the best solution :).
>>
>>
>>> On Feb 19, 2017, at 11:42 AM, stepharong <stepharong(a)free.fr> wrote:
>>>
>>> On Sun, 19 Feb 2017 11:40:04 +0100, Sven Van Caekenberghe
>>> <sven(a)stfx.eu> wrote:
>>>
>>>> Ah, you're right: there is a difference between printing a textual
>>>> representation on a stream / window and doing the same with the
>>>> actual (print)string. I was not yet >>>>fully awake I guess.
>>>
>>> So
>>> 'comics'
>>> >>> comics whatever it means
>>> but
>>> (#AAA asClass new name: 'comics')
>>> >>> âcomics'
>>
>> Itâs the other way around :).
>>
>> Example A:
>> 'comics'
>> >>print it>> âcomicsâ In this case we have a string object and we send
>> printString to it which in String>>storeOn: adds the quotes as part of
>> the contents of the new string.
>>
>> Example B:
>> (#AAA asClass new name: 'comics')
>> >>print it>> comics Here we have an non-string object and we sent
>> printString to it which creates a string with the contents of the
>> stream. As no String>>storeOn: is invoked in this case, there are no
>> >>quotes.
>>
>> So, the two resulting print it strings do not have the same contents.
>>
>> Maybe another case:
>>
>> Example C:
>> (#AAA asClass new name: 'comicsâ) printString
>> >>print it>> âcomicsâ
>> This is equivalent to Example A. We send printString to a string
>> object and we get the quotes.
>>
>> The issue is that when we send printString to a string, we produce a
>> new string with escaped quotes:
>> 'comics' = (String streamContents: [:s | s << 'comicsâ]) contents.
>> "true"
>> 'comics' = (String streamContents: [:s | s << 'comics']) contents
>> printString. "false"
>>
>>
>>> I'm sorry but I do not get it at all.
>>> Especially since we always wrote that printIt is sending printString.
>>> I find that totally broken and I do not understand why this is good.
>>
>> Another thing to keep in mind is:
>>
>> Example D:
>> Object new
>> >>print it>> an Object
>> This is essentially equivalent with Example A
>>
>> If Example B would produce >>print it>> âcomicsâ
>> it would mean that Example D would produce
>> >>print it>> âan Objectâ
>>
>> Ugh, I already got dizzy with so many quotes :).
>>
>> One problem is that when you look at a string, you do not know how many
>> String>>storeOn: commands it went through. So, here is an idea: what if
>> String>>printString would produce a >>EscapedString, which behaves like
>> an operator? In this case, we would see better how many levels of
>> String>>storeOn: are being displayed.
>>
>> What do you think?
>>
>> Cheers,
>> Doru
>>
>>
>>> Stef
>>>
>>>
>>>
>>>
>>>>
>>>>> On 19 Feb 2017, at 10:59, Tudor Girba <tudor(a)tudorgirba.com> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Hmm, I think I do not see it :).
>>>>>
>>>>> Letâs take it slowly. From what I see, the behavior is the same
>>>>> since at least Pharo 3.
>>>>>
>>>>> Here is a script that seems to reproduce your situation:
>>>>>
>>>>> Object subclass: #AAA
>>>>> instanceVariableNames: 'name'
>>>>> classVariableNames: ''
>>>>> package: 'AAA'.
>>>>> #AAA asClass compile: 'printOn: aStream
>>>>> aStream << name'.
>>>>> #AAA asClass compile: 'name: aString
>>>>> name := aString'.
>>>>> #AAA asClass new name: 'comics'
>>>>>
>>>>> In Pharo 6, we have in a Playground:
>>>>>
>>>>> <Screen Shot 2017-02-19 at 10.48.55 AM.png>
>>>>>
>>>>> In Pharo 3, we have this in a Workspace:
>>>>>
>>>>> <Screen Shot 2017-02-19 at 10.49.26 AM.png>
>>>>>
>>>>> Calling Print It on an object produces a string out of the contents
>>>>> of the stream, and displaying it shows the contents of the stream
>>>>> (so, no quotes). >>>>>Calling Print It on a string produces a string
>>>>> of the string, and displaying it shows the quotes of the first
>>>>> string.
>>>>>
>>>>> You can see this in the String tab of the inspector:
>>>>>
>>>>> <p1.png>
>>>>>
>>>>>
>>>>> <p2.png>
>>>>>
>>>>> Does this make sense?
>>>>>
>>>>> I think this is not inconsistent, but maybe there is a better way.
>>>>> In any case, the behavior seems to exist since a long time.
>>>>>
>>>>> Cheers,
>>>>> Doru
>>>>>
>>>>>
>>>>>> On Feb 19, 2017, at 9:06 AM, stepharong <stepharong(a)free.fr> wrote:
>>>>>>
>>>>>> 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'
>>>>>>
>>>>>> <Mail Attachment.png>
>>>>>>
>>>>>> What am I missing?
>>>>>>
>>>>>> Cheers,
>>>>>> Doru
>>>>>>
>>>>>>
>>>>>>> On Feb 18, 2017, at 6:26 PM, stepharong <stepharong(a)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/
>>>>>> <MFElement.st>
>>>>>
>>>>> --
>>>>> www.tudorgirba.com
>>>>> www.feenk.com
>>>>>
>>>>> "Problem solving should be focused on describing
>>>>> the problem in a way that makes the solution obvious."
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --Using Opera's mail client: http://www.opera.com/mail/
>>
>> --
>> www.tudorgirba.com
>> www.feenk.com
>>
>> "From an abstract enough point of view, any two things are similar."
>>
>>
>>
>>
>
>
>
> --Using Opera's mail client: http://www.opera.com/mail/
--
Using Opera's mail client: http://www.opera.com/mail/
Feb. 19, 2017
Re: [Pharo-dev] confused about printString and printIt
by stepharong
Hi John
> The tools aren't the ones putting the quotes around the string. Calling
> #printString on a String puts the quotes around the string. If you were
> to put quotes around other printString's then you would need to special
> case String to not put the quotes around twice.
I do not understand your printString point.
to me printString contract is: return a string to represent the receiver
(not talking about self evaluating objects here).
so why when I have
(MFDirectory new name: 'comics') printIt
I do not get why I do not get
'comics' but comics
since printIt invokes printString?
Now I probably broke myself this contract when I introduced
self-evaluating objects.
true printIt
>>> true is probably wrong.
May be printIt is the wrong name.
May be this is displayResult
I do not know there is something confusing.
I'm confuse ;(
> The current implementation looks right to me. #printString returns a
> string to help developers. #printString on some objects returns a string
> that when evaluated creates an equivalent object (e.g., String, Point,
> etc.).
I did the self-evaluating behavior and I'm thinking that may be this is
wrong and that
we should always get a string not matter what happens.
> However, on other objects it returns a string that only helps the
> developer see what the object is (e.g., OrderedCollection). The trick is
> to know which object's printString can be evaluated and which are only
> for display.
This is where I think that displayString is different than printString and
that
printString no matter what should be consitent
I should return a string and the tools like the repl should display such
as a string.
This is also where
> Of course, if you want a string that you can evaluate, you should use
> #storeString.
>
>
> John Brant
>
--
Using Opera's mail client: http://www.opera.com/mail/
Feb. 19, 2017
Re: [Pharo-dev] confused about printString and printIt
by stepharong
Hi doru
Yes I know. I did not imply anything.
I think that the current status is bogus.
I do not see any scenario that makes printString not returning and
displaying a string good.
I do not get why
'comics' printString should double quote it.
to me
'comics' printString
>>>
'comics'
'comics' printIt
>>>
'comics'
as well as
(#AAA asClass new name: 'comics') PrintIt
I just to not get what is the benefit not to have in the workspace or any
users of printIt no single quote
I agree that for a list of items
you do not want to have
'astroboy'
'tintin'
but instead
astroboy
tintin
I see that lot of people got confused about that. Just look at the cuboid
videos of Roassal you get comboboxes full of ' ' while there should not
have any.
Now to me this is the job of displayString.
displayString is not the same as printString.
printString should return a string and I should see a string in the REPL
Currently in the REPL because this is what we are talking about
obtaining a non string is confusing.
Am I clear?
Stef
> Hi Stef,
>
> Just a clarification. I do not argue here. I just explain what I see. I
> think it was like this since a long time. I even checked in an old VW I
> have around and it seems to have the same behavior.
>
> But, I do agree that it is not straightforward at all. It took me a
> while to figure this out and it is still confusing sometimes. In fact,
> this is why we have a String presentation in the String object - I
> >needed something that clarifies situations like these. That does not
> mean it is the best solution :).
>
>
>> On Feb 19, 2017, at 11:42 AM, stepharong <stepharong(a)free.fr> wrote:
>>
>> On Sun, 19 Feb 2017 11:40:04 +0100, Sven Van Caekenberghe
>> <sven(a)stfx.eu> wrote:
>>
>>> Ah, you're right: there is a difference between printing a textual
>>> representation on a stream / window and doing the same with the actual
>>> (print)string. I was not yet >>>fully awake I guess.
>>
>> So
>> 'comics'
>> >>> comics whatever it means
>> but
>> (#AAA asClass new name: 'comics')
>> >>> âcomics'
>
> Itâs the other way around :).
>
> Example A:
> 'comics'
> >>print it>> âcomicsâ In this case we have a string object and we send
> printString to it which in String>>storeOn: adds the quotes as part of
> the contents of the new string.
>
> Example B:
> (#AAA asClass new name: 'comics')
> >>print it>> comics Here we have an non-string object and we sent
> printString to it which creates a string with the contents of the
> stream. As no String>>storeOn: is invoked in this case, there are no
> >quotes.
>
> So, the two resulting print it strings do not have the same contents.
>
> Maybe another case:
>
> Example C:
> (#AAA asClass new name: 'comicsâ) printString
> >>print it>> âcomicsâ
> This is equivalent to Example A. We send printString to a string object
> and we get the quotes.
>
> The issue is that when we send printString to a string, we produce a new
> string with escaped quotes:
> 'comics' = (String streamContents: [:s | s << 'comicsâ]) contents.
> "true"
> 'comics' = (String streamContents: [:s | s << 'comics']) contents
> printString. "false"
>
>
>> I'm sorry but I do not get it at all.
>> Especially since we always wrote that printIt is sending printString.
>> I find that totally broken and I do not understand why this is good.
>
> Another thing to keep in mind is:
>
> Example D:
> Object new
> >>print it>> an Object
> This is essentially equivalent with Example A
>
> If Example B would produce >>print it>> âcomicsâ
> it would mean that Example D would produce
> >>print it>> âan Objectâ
>
> Ugh, I already got dizzy with so many quotes :).
>
> One problem is that when you look at a string, you do not know how many
> String>>storeOn: commands it went through. So, here is an idea: what if
> String>>printString would produce a >EscapedString, which behaves like
> an operator? In this case, we would see better how many levels of
> String>>storeOn: are being displayed.
>
> What do you think?
>
> Cheers,
> Doru
>
>
>> Stef
>>
>>
>>
>>
>>>
>>>> On 19 Feb 2017, at 10:59, Tudor Girba <tudor(a)tudorgirba.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> Hmm, I think I do not see it :).
>>>>
>>>> Letâs take it slowly. From what I see, the behavior is the same since
>>>> at least Pharo 3.
>>>>
>>>> Here is a script that seems to reproduce your situation:
>>>>
>>>> Object subclass: #AAA
>>>> instanceVariableNames: 'name'
>>>> classVariableNames: ''
>>>> package: 'AAA'.
>>>> #AAA asClass compile: 'printOn: aStream
>>>> aStream << name'.
>>>> #AAA asClass compile: 'name: aString
>>>> name := aString'.
>>>> #AAA asClass new name: 'comics'
>>>>
>>>> In Pharo 6, we have in a Playground:
>>>>
>>>> <Screen Shot 2017-02-19 at 10.48.55 AM.png>
>>>>
>>>> In Pharo 3, we have this in a Workspace:
>>>>
>>>> <Screen Shot 2017-02-19 at 10.49.26 AM.png>
>>>>
>>>> Calling Print It on an object produces a string out of the contents
>>>> of the stream, and displaying it shows the contents of the stream
>>>> (so, no quotes). >>>>Calling Print It on a string produces a string
>>>> of the string, and displaying it shows the quotes of the first string.
>>>>
>>>> You can see this in the String tab of the inspector:
>>>>
>>>> <p1.png>
>>>>
>>>>
>>>> <p2.png>
>>>>
>>>> Does this make sense?
>>>>
>>>> I think this is not inconsistent, but maybe there is a better way. In
>>>> any case, the behavior seems to exist since a long time.
>>>>
>>>> Cheers,
>>>> Doru
>>>>
>>>>
>>>>> On Feb 19, 2017, at 9:06 AM, stepharong <stepharong(a)free.fr> wrote:
>>>>>
>>>>> 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'
>>>>>
>>>>> <Mail Attachment.png>
>>>>>
>>>>> What am I missing?
>>>>>
>>>>> Cheers,
>>>>> Doru
>>>>>
>>>>>
>>>>>> On Feb 18, 2017, at 6:26 PM, stepharong <stepharong(a)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/
>>>>> <MFElement.st>
>>>>
>>>> --
>>>> www.tudorgirba.com
>>>> www.feenk.com
>>>>
>>>> "Problem solving should be focused on describing
>>>> the problem in a way that makes the solution obvious."
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>> --Using Opera's mail client: http://www.opera.com/mail/
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "From an abstract enough point of view, any two things are similar."
>
>
>
>
--
Using Opera's mail client: http://www.opera.com/mail/
Feb. 19, 2017
Re: [Pharo-dev] confused about printString and printIt
by John Brant
On 02/19/2017 04:37 AM, stepharong wrote:
> I do not say that it is a problem of playground. I'm saying that our
> tools are breaking an important invariant.
> Printit should not produce "strings" that are not objects.
>
> What I'm saying it that
> - axiom one printString returns a string.
> - printIt send printString to the object and why does it no
> display a string
> except for objects whose representation is themselves.
>
> The problem not to put '' around string is that we get a broken things.
The tools aren't the ones putting the quotes around the string. Calling
#printString on a String puts the quotes around the string. If you were
to put quotes around other printString's then you would need to special
case String to not put the quotes around twice.
The current implementation looks right to me. #printString returns a
string to help developers. #printString on some objects returns a string
that when evaluated creates an equivalent object (e.g., String, Point,
etc.). However, on other objects it returns a string that only helps the
developer see what the object is (e.g., OrderedCollection). The trick is
to know which object's printString can be evaluated and which are only
for display. Of course, if you want a string that you can evaluate, you
should use #storeString.
John Brant
Feb. 19, 2017
Re: [Pharo-dev] confused about printString and printIt
by Tudor Girba
Hi Stef,
Just a clarification. I do not argue here. I just explain what I see. I think it was like this since a long time. I even checked in an old VW I have around and it seems to have the same behavior.
But, I do agree that it is not straightforward at all. It took me a while to figure this out and it is still confusing sometimes. In fact, this is why we have a String presentation in the String object - I needed something that clarifies situations like these. That does not mean it is the best solution :).
> On Feb 19, 2017, at 11:42 AM, stepharong <stepharong(a)free.fr> wrote:
>
> On Sun, 19 Feb 2017 11:40:04 +0100, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>
>> Ah, you're right: there is a difference between printing a textual representation on a stream / window and doing the same with the actual (print)string. I was not yet fully awake I guess.
>
> So
> 'comics'
> >>> comics whatever it means
> but
> (#AAA asClass new name: 'comics')
> >>> âcomics'
Itâs the other way around :).
Example A:
'comics'
>>print it>> âcomicsâ
In this case we have a string object and we send printString to it which in String>>storeOn: adds the quotes as part of the contents of the new string.
Example B:
(#AAA asClass new name: 'comics')
>>print it>> comics
Here we have an non-string object and we sent printString to it which creates a string with the contents of the stream. As no String>>storeOn: is invoked in this case, there are no quotes.
So, the two resulting print it strings do not have the same contents.
Maybe another case:
Example C:
(#AAA asClass new name: 'comicsâ) printString
>>print it>> âcomicsâ
This is equivalent to Example A. We send printString to a string object and we get the quotes.
The issue is that when we send printString to a string, we produce a new string with escaped quotes:
'comics' = (String streamContents: [:s | s << 'comicsâ]) contents. "true"
'comics' = (String streamContents: [:s | s << 'comics']) contents printString. "false"
> I'm sorry but I do not get it at all.
> Especially since we always wrote that printIt is sending printString.
> I find that totally broken and I do not understand why this is good.
Another thing to keep in mind is:
Example D:
Object new
>>print it>> an Object
This is essentially equivalent with Example A
If Example B would produce
>>print it>> âcomicsâ
it would mean that Example D would produce
>>print it>> âan Objectâ
Ugh, I already got dizzy with so many quotes :).
One problem is that when you look at a string, you do not know how many String>>storeOn: commands it went through. So, here is an idea: what if String>>printString would produce a EscapedString, which behaves like an operator? In this case, we would see better how many levels of String>>storeOn: are being displayed.
What do you think?
Cheers,
Doru
> Stef
>
>
>
>
>>
>>> On 19 Feb 2017, at 10:59, Tudor Girba <tudor(a)tudorgirba.com> wrote:
>>>
>>> Hi,
>>>
>>> Hmm, I think I do not see it :).
>>>
>>> Letâs take it slowly. From what I see, the behavior is the same since at least Pharo 3.
>>>
>>> Here is a script that seems to reproduce your situation:
>>>
>>> Object subclass: #AAA
>>> instanceVariableNames: 'name'
>>> classVariableNames: ''
>>> package: 'AAA'.
>>> #AAA asClass compile: 'printOn: aStream
>>> aStream << name'.
>>> #AAA asClass compile: 'name: aString
>>> name := aString'.
>>> #AAA asClass new name: 'comics'
>>>
>>> In Pharo 6, we have in a Playground:
>>>
>>> <Screen Shot 2017-02-19 at 10.48.55 AM.png>
>>>
>>> In Pharo 3, we have this in a Workspace:
>>>
>>> <Screen Shot 2017-02-19 at 10.49.26 AM.png>
>>>
>>> Calling Print It on an object produces a string out of the contents of the stream, and displaying it shows the contents of the stream (so, no quotes). Calling Print It on a string produces a string of the string, and displaying it shows the quotes of the first string.
>>>
>>> You can see this in the String tab of the inspector:
>>>
>>> <p1.png>
>>>
>>>
>>> <p2.png>
>>>
>>> Does this make sense?
>>>
>>> I think this is not inconsistent, but maybe there is a better way. In any case, the behavior seems to exist since a long time.
>>>
>>> Cheers,
>>> Doru
>>>
>>>
>>>> On Feb 19, 2017, at 9:06 AM, stepharong <stepharong(a)free.fr> wrote:
>>>>
>>>> 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'
>>>>
>>>> <Mail Attachment.png>
>>>>
>>>> What am I missing?
>>>>
>>>> Cheers,
>>>> Doru
>>>>
>>>>
>>>>> On Feb 18, 2017, at 6:26 PM, stepharong <stepharong(a)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/
>>>> <MFElement.st>
>>>
>>> --
>>> www.tudorgirba.com
>>> www.feenk.com
>>>
>>> "Problem solving should be focused on describing
>>> the problem in a way that makes the solution obvious."
>>>
>>>
>>>
>>>
>>>
>>
>
>
> --
> Using Opera's mail client: http://www.opera.com/mail/
--
www.tudorgirba.com
www.feenk.com
"From an abstract enough point of view, any two things are similar."
Feb. 19, 2017
Development dashboard for pharo-project repositories
by Rafael Luque
Hi guys!
I've just created a development analytics dashboard for the pharo-project
organization at GitHub using Cauldron [1], a proof-of-concept by Bitergia,
a University spin-off here in Madrid.
You can play with the dashboard at: https://cauldron.io/
dashboards/pharo-project
I expect you enjoy it and get insights about the Pharo community.
[1] https://cauldron.io/
--
Rafael Luque
Feb. 19, 2017
Re: [Pharo-dev] confused about printString and printIt
by Tudor Girba
Hi Sven,
It seems to me that we are now talking about double quote â. However, this is just a tool issue related to how to embed the result of Print It.
Just to remove the confusion, please resend this message without the âcommentâ printing :). Cmd-p + Cmd+p gets the plain result embedded.
Cheers,
Doru
> On Feb 19, 2017, at 12:14 PM, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>
> But this *is* a discussion about the tools, not the implementation.
>
> ZnUrl is an example of class in the image that has a print representation like your object.
>
> So it looks like this (doing Print It in a Playground) (for me):
>
> 'https://pharo.org' asUrl. "https://pharo.org/"
> 'https://pharo.org' asUrl printString. "'https://pharo.org/'"
>
> But you seem to use a modification where the $" are not used ?
>
> I guess that the reason those $" are there is to make it a legal expression.
>
> Anyway, I do not see an underlying problem, only a possible discussion about what you would expect from the tools.
>
> Strings are poor representations, make them auto evaluate would make for much uglier text.
>
> I would not particularly like the following:
>
> 'https://pharo.org' asUrl. "ZnUrl fromString: 'https://pharo.org'"
>
> Or even:
>
> 'https://pharo.org' asUrl. "(ZnUrl fromString: 'https://pharo.org')"
>
> Though it is an option. (This goes for all similar objects, like date, time, ..).
>
> Then it does become a discussion about what a print string should be.
>
>> On 19 Feb 2017, at 11:42, stepharong <stepharong(a)free.fr> wrote:
>>
>> On Sun, 19 Feb 2017 11:40:04 +0100, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>>
>>> Ah, you're right: there is a difference between printing a textual representation on a stream / window and doing the same with the actual (print)string. I was not yet fully awake I guess.
>>
>> So
>> 'comics'
>> >>> comics whatever it means
>> but
>> (#AAA asClass new name: 'comics')
>> >>> 'comics'
>>
>> I'm sorry but I do not get it at all.
>> Especially since we always wrote that printIt is sending printString.
>> I find that totally broken and I do not understand why this is good.
>>
>> Stef
>>
>>
>>
>>
>>>
>>>> On 19 Feb 2017, at 10:59, Tudor Girba <tudor(a)tudorgirba.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> Hmm, I think I do not see it :).
>>>>
>>>> Letâs take it slowly. From what I see, the behavior is the same since at least Pharo 3.
>>>>
>>>> Here is a script that seems to reproduce your situation:
>>>>
>>>> Object subclass: #AAA
>>>> instanceVariableNames: 'name'
>>>> classVariableNames: ''
>>>> package: 'AAA'.
>>>> #AAA asClass compile: 'printOn: aStream
>>>> aStream << name'.
>>>> #AAA asClass compile: 'name: aString
>>>> name := aString'.
>>>> #AAA asClass new name: 'comics'
>>>>
>>>> In Pharo 6, we have in a Playground:
>>>>
>>>> <Screen Shot 2017-02-19 at 10.48.55 AM.png>
>>>>
>>>> In Pharo 3, we have this in a Workspace:
>>>>
>>>> <Screen Shot 2017-02-19 at 10.49.26 AM.png>
>>>>
>>>> Calling Print It on an object produces a string out of the contents of the stream, and displaying it shows the contents of the stream (so, no quotes). Calling Print It on a string produces a string of the string, and displaying it shows the quotes of the first string.
>>>>
>>>> You can see this in the String tab of the inspector:
>>>>
>>>> <p1.png>
>>>>
>>>>
>>>> <p2.png>
>>>>
>>>> Does this make sense?
>>>>
>>>> I think this is not inconsistent, but maybe there is a better way. In any case, the behavior seems to exist since a long time.
>>>>
>>>> Cheers,
>>>> Doru
>>>>
>>>>
>>>>> On Feb 19, 2017, at 9:06 AM, stepharong <stepharong(a)free.fr> wrote:
>>>>>
>>>>> 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'
>>>>>
>>>>> <Mail Attachment.png>
>>>>>
>>>>> What am I missing?
>>>>>
>>>>> Cheers,
>>>>> Doru
>>>>>
>>>>>
>>>>>> On Feb 18, 2017, at 6:26 PM, stepharong <stepharong(a)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/
>>>>> <MFElement.st>
>>>>
>>>> --
>>>> www.tudorgirba.com
>>>> www.feenk.com
>>>>
>>>> "Problem solving should be focused on describing
>>>> the problem in a way that makes the solution obvious."
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>> --
>> Using Opera's mail client: http://www.opera.com/mail/
>
>
--
www.tudorgirba.com
www.feenk.com
"We can create beautiful models in a vacuum.
But, to get them effective we have to deal with the inconvenience of reality."
Feb. 19, 2017
Re: [Pharo-dev] confused about printString and printIt
by Sven Van Caekenberghe
But this *is* a discussion about the tools, not the implementation.
ZnUrl is an example of class in the image that has a print representation like your object.
So it looks like this (doing Print It in a Playground) (for me):
'https://pharo.org' asUrl. "https://pharo.org/"
'https://pharo.org' asUrl printString. "'https://pharo.org/'"
But you seem to use a modification where the $" are not used ?
I guess that the reason those $" are there is to make it a legal expression.
Anyway, I do not see an underlying problem, only a possible discussion about what you would expect from the tools.
Strings are poor representations, make them auto evaluate would make for much uglier text.
I would not particularly like the following:
'https://pharo.org' asUrl. "ZnUrl fromString: 'https://pharo.org'"
Or even:
'https://pharo.org' asUrl. "(ZnUrl fromString: 'https://pharo.org')"
Though it is an option. (This goes for all similar objects, like date, time, ..).
Then it does become a discussion about what a print string should be.
> On 19 Feb 2017, at 11:42, stepharong <stepharong(a)free.fr> wrote:
>
> On Sun, 19 Feb 2017 11:40:04 +0100, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>
>> Ah, you're right: there is a difference between printing a textual representation on a stream / window and doing the same with the actual (print)string. I was not yet fully awake I guess.
>
> So
> 'comics'
> >>> comics whatever it means
> but
> (#AAA asClass new name: 'comics')
> >>> 'comics'
>
> I'm sorry but I do not get it at all.
> Especially since we always wrote that printIt is sending printString.
> I find that totally broken and I do not understand why this is good.
>
> Stef
>
>
>
>
>>
>>> On 19 Feb 2017, at 10:59, Tudor Girba <tudor(a)tudorgirba.com> wrote:
>>>
>>> Hi,
>>>
>>> Hmm, I think I do not see it :).
>>>
>>> Letâs take it slowly. From what I see, the behavior is the same since at least Pharo 3.
>>>
>>> Here is a script that seems to reproduce your situation:
>>>
>>> Object subclass: #AAA
>>> instanceVariableNames: 'name'
>>> classVariableNames: ''
>>> package: 'AAA'.
>>> #AAA asClass compile: 'printOn: aStream
>>> aStream << name'.
>>> #AAA asClass compile: 'name: aString
>>> name := aString'.
>>> #AAA asClass new name: 'comics'
>>>
>>> In Pharo 6, we have in a Playground:
>>>
>>> <Screen Shot 2017-02-19 at 10.48.55 AM.png>
>>>
>>> In Pharo 3, we have this in a Workspace:
>>>
>>> <Screen Shot 2017-02-19 at 10.49.26 AM.png>
>>>
>>> Calling Print It on an object produces a string out of the contents of the stream, and displaying it shows the contents of the stream (so, no quotes). Calling Print It on a string produces a string of the string, and displaying it shows the quotes of the first string.
>>>
>>> You can see this in the String tab of the inspector:
>>>
>>> <p1.png>
>>>
>>>
>>> <p2.png>
>>>
>>> Does this make sense?
>>>
>>> I think this is not inconsistent, but maybe there is a better way. In any case, the behavior seems to exist since a long time.
>>>
>>> Cheers,
>>> Doru
>>>
>>>
>>>> On Feb 19, 2017, at 9:06 AM, stepharong <stepharong(a)free.fr> wrote:
>>>>
>>>> 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'
>>>>
>>>> <Mail Attachment.png>
>>>>
>>>> What am I missing?
>>>>
>>>> Cheers,
>>>> Doru
>>>>
>>>>
>>>>> On Feb 18, 2017, at 6:26 PM, stepharong <stepharong(a)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/
>>>> <MFElement.st>
>>>
>>> --
>>> www.tudorgirba.com
>>> www.feenk.com
>>>
>>> "Problem solving should be focused on describing
>>> the problem in a way that makes the solution obvious."
>>>
>>>
>>>
>>>
>>>
>>
>
>
> --
> Using Opera's mail client: http://www.opera.com/mail/
Feb. 19, 2017