Why do we have doublequoting for "?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Why do we have doublequoting for "?

stepharong
about quoting ;(

Hi

I have a string

  '<li>
<span class="author">St&eacute;phane Ducasse and Damien Pollet</span>,  
<span class="title">Fingerprints</span>, <span class="journal">Journal of  
Information System</span>, <span class="year">2010</span>.
</li>
'

and when I do printIt in the debugger I get the following


  "'<li>
<span class=""author"">St&eacute;phane Ducasse and Damien Pollet</span>,  
<span class=""title"">Fingerprints</span>, <span class=""journal"">Journal  
of Information System</span>, <span class=""year"">2010</span>.
</li>
'"

I do not get why we doublequote the character "
inside string.

It means that I have to remove all the " inside to string to be able to  
express tests.

Stef

Reply | Threaded
Open this post in threaded view
|

Re: Why do we have doublequoting for "?

gcotelli
Try doing Ctrl+P twice. It will not comment the printed string.

On Thu, Feb 23, 2017 at 4:17 PM, stepharong <[hidden email]> wrote:
about quoting ;(

Hi

I have a string

 '<li>
<span class="author">St&eacute;phane Ducasse and Damien Pollet</span>, <span class="title">Fingerprints</span>, <span class="journal">Journal of Information System</span>, <span class="year">2010</span>.
</li>
'

and when I do printIt in the debugger I get the following


 "'<li>
<span class=""author"">St&eacute;phane Ducasse and Damien Pollet</span>, <span class=""title"">Fingerprints</span>, <span class=""journal"">Journal of Information System</span>, <span class=""year"">2010</span>.
</li>
'"

I do not get why we doublequote the character "
inside string.

It means that I have to remove all the " inside to string to be able to express tests.

Stef


Reply | Threaded
Open this post in threaded view
|

Re: Why do we have doublequoting for "?

stepharong
Thnkas gabriel
I'm hacking in an old Pharo 50 image and it was terrible because printit even a copyReplaceAll: '""' byt: '"'
did not work. 
I do not understand what is the scenario to double quote comment character " 

I understand single quotes but not double quotes. 
stef

Try doing Ctrl+P twice. It will not comment the printed string.

On Thu, Feb 23, 2017 at 4:17 PM, stepharong <[hidden email]> wrote:
about quoting ;(

Hi

I have a string

 '<li>
<span class="author">St&eacute;phane Ducasse and Damien Pollet</span>, <span class="title">Fingerprints</span>, <span class="journal">Journal of Information System</span>, <span class="year">2010</span>.
</li>
'

and when I do printIt in the debugger I get the following


 "'<li>
<span class=""author"">St&eacute;phane Ducasse and Damien Pollet</span>, <span class=""title"">Fingerprints</span>, <span class=""journal"">Journal of Information System</span>, <span class=""year"">2010</span>.
</li>
'"

I do not get why we doublequote the character "
inside string.

It means that I have to remove all the " inside to string to be able to express tests.

Stef





--
Using Opera's mail client: http://www.opera.com/mail/
Reply | Threaded
Open this post in threaded view
|

Re: Why do we have doublequoting for "?

Uko2
So if you paste this as a comment somewhere you don’t have to manually add double double-quotes.

I don’t use the result of print it at all, but I guess there are two scenarios for it’s usage. One as you described: copy the result and use it in tests or in some further computation. (but if you use TDD test are already written ;P). Another one is to copy the result and paste it somewhere as a comment in your code, to access it easily afterwards. If you have a double quote in your result it will break the comment, so the thing is escaped automatically.

Uko

On 23 Feb 2017, at 22:25, stepharong <[hidden email]> wrote:

Thnkas gabriel
I'm hacking in an old Pharo 50 image and it was terrible because printit even a copyReplaceAll: '""' byt: '"'
did not work. 
I do not understand what is the scenario to double quote comment character " 

I understand single quotes but not double quotes. 
stef

Try doing Ctrl+P twice. It will not comment the printed string.

On Thu, Feb 23, 2017 at 4:17 PM, stepharong <[hidden email]> wrote:
about quoting ;(

Hi

I have a string

 '<li>
<span class="author">St&eacute;phane Ducasse and Damien Pollet</span>, <span class="title">Fingerprints</span>, <span class="journal">Journal of Information System</span>, <span class="year">2010</span>.
</li>
'

and when I do printIt in the debugger I get the following


 "'<li>
<span class=""author"">St&eacute;phane Ducasse and Damien Pollet</span>, <span class=""title"">Fingerprints</span>, <span class=""journal"">Journal of Information System</span>, <span class=""year"">2010</span>.
</li>
'"

I do not get why we doublequote the character "
inside string.

It means that I have to remove all the " inside to string to be able to express tests.

Stef





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

Reply | Threaded
Open this post in threaded view
|

Re: Why do we have doublequoting for "?

stepharong
Yuriy


Why does it make sense to have "" "" inside strings?


So if you paste this as a comment somewhere you don’t have to manually add double double-quotes.

Did you read my example?
I do not need any double double quotes. 


I don’t use the result of print it at all, but I guess there are two scenarios for it’s usage. One as you described: copy the result and use it in tests or in some further computation.

But this is exactly what I cannot do with this stupid doubling of double quotes

(but if you use TDD test are already written ;P).

well...

Another one is to copy the result and paste it somewhere as a comment in your code, to access it easily afterwards. If you have a double quote in your result it will break the comment, so the thing is escaped automatically.

Probably but here this is inside a string. 
I think that this heuristic is totally bogus. 


Uko

On 23 Feb 2017, at 22:25, stepharong <[hidden email]> wrote:

Thnkas gabriel
I'm hacking in an old Pharo 50 image and it was terrible because printit even a copyReplaceAll: '""' byt: '"'
did not work. 
I do not understand what is the scenario to double quote comment character " 

I understand single quotes but not double quotes. 
stef

Try doing Ctrl+P twice. It will not comment the printed string.

On Thu, Feb 23, 2017 at 4:17 PM, stepharong <[hidden email]> wrote:
about quoting ;(

Hi

I have a string

 '<li>
<span class="author">St&eacute;phane Ducasse and Damien Pollet</span>, <span class="title">Fingerprints</span>, <span class="journal">Journal of Information System</span>, <span class="year">2010</span>.
</li>
'

and when I do printIt in the debugger I get the following


 "'<li>
<span class=""author"">St&eacute;phane Ducasse and Damien Pollet</span>, <span class=""title"">Fingerprints</span>, <span class=""journal"">Journal of Information System</span>, <span class=""year"">2010</span>.
</li>
'"

I do not get why we doublequote the character "
inside string.

It means that I have to remove all the " inside to string to be able to express tests.

Stef





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




--
Using Opera's mail client: http://www.opera.com/mail/
Reply | Threaded
Open this post in threaded view
|

Re: Why do we have doublequoting for "?

Tudor Girba-2
Hi Stef,

Just a clarification.

The mechanism you mention is obtained through Cmd+p, Enter and this embeds the printout as a comment in the existing editor. This is particularly useful when you want to keep a trace of multiple executions in the same editor (typically a Playground). In order to make any string a valid Pharo comment we use String>>asComment, and this escapes “ (double-quote) inside a comment. Without it, the result would not be a valid comment and the syntax highlighting would be broken.

For your goal of having the result in the debugger this is obviously not ideal. This is why we ended up with Cmd+p,Cmd+p, but this is not available in Pharo 5.

Cheers,
Doru


> On Feb 24, 2017, at 8:30 AM, stepharong <[hidden email]> wrote:
>
> Yuriy
>
>
> Why does it make sense to have "" "" inside strings?
>
>
> So if you paste this as a comment somewhere you don’t have to manually add double double-quotes.
>
> Did you read my example?
> I do not need any double double quotes.
>
>
> I don’t use the result of print it at all, but I guess there are two scenarios for it’s usage. One as you described: copy the result and use it in tests or in some further computation.
>
> But this is exactly what I cannot do with this stupid doubling of double quotes
>
> (but if you use TDD test are already written ;P).
>
> well...
>
> Another one is to copy the result and paste it somewhere as a comment in your code, to access it easily afterwards. If you have a double quote in your result it will break the comment, so the thing is escaped automatically.
>
> Probably but here this is inside a string.
> I think that this heuristic is totally bogus.
>
>
> Uko
>
>> On 23 Feb 2017, at 22:25, stepharong <[hidden email]> wrote:
>>
>> Thnkas gabriel
>> I'm hacking in an old Pharo 50 image and it was terrible because printit even a copyReplaceAll: '""' byt: '"'
>> did not work.
>> I do not understand what is the scenario to double quote comment character "
>>
>> I understand single quotes but not double quotes.
>> stef
>>
>> Try doing Ctrl+P twice. It will not comment the printed string.
>>
>> On Thu, Feb 23, 2017 at 4:17 PM, stepharong <[hidden email]> wrote:
>> about quoting ;(
>>
>> Hi
>>
>> I have a string
>>
>>  '<li>
>> <span class="author">St&eacute;phane Ducasse and Damien Pollet</span>, <span class="title">Fingerprints</span>, <span class="journal">Journal of Information System</span>, <span class="year">2010</span>.
>> </li>
>> '
>>
>> and when I do printIt in the debugger I get the following
>>
>>
>>  "'<li>
>> <span class=""author"">St&eacute;phane Ducasse and Damien Pollet</span>, <span class=""title"">Fingerprints</span>, <span class=""journal"">Journal of Information System</span>, <span class=""year"">2010</span>.
>> </li>
>> '"
>>
>> I do not get why we doublequote the character "
>> inside string.
>>
>> It means that I have to remove all the " inside to string to be able to express tests.
>>
>> Stef
>>
>>
>>
>>
>>
>> --
>> Using Opera's mail client: http://www.opera.com/mail/
>
>
>
>
> --
> Using Opera's mail client: http://www.opera.com/mail/

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

"Innovation comes in the least expected form.
That is, if it is expected, it already happened."


Reply | Threaded
Open this post in threaded view
|

Re: Why do we have doublequoting for "?

stepharong
To me it looks wrong and it breaks flow. The poor guys working on XML  
should just suicide with such
behavior. You can never print anything decently.
I think that the tools are hijacking printString and turn it into  
something mega strange and bogus.
I cannot even use plain Pharo code to survive.
        copyReplaceAll: '""' byt: '"'

Stef

> Hi Stef,
>
> Just a clarification.
>
> The mechanism you mention is obtained through Cmd+p, Enter and this  
> embeds the printout as a comment in the existing editor. This is  
> particularly useful when you want to keep a trace of multiple executions  
> in the same editor (typically a Playground). In order to make any string  
> a valid Pharo comment we use String>>asComment, and this escapes “  
> (double-quote) inside a comment. Without it, the result would not be a  
> valid comment and the syntax highlighting would be broken.
>
> For your goal of having the result in the debugger this is obviously not  
> ideal. This is why we ended up with Cmd+p,Cmd+p, but this is not  
> available in Pharo 5.
>
> Cheers,
> Doru
>
>
>> On Feb 24, 2017, at 8:30 AM, stepharong <[hidden email]> wrote:
>>
>> Yuriy
>>
>>
>> Why does it make sense to have "" "" inside strings?
>>
>>
>> So if you paste this as a comment somewhere you don’t have to manually  
>> add double double-quotes.
>>
>> Did you read my example?
>> I do not need any double double quotes.
>>
>>
>> I don’t use the result of print it at all, but I guess there are two  
>> scenarios for it’s usage. One as you described: copy the result and use  
>> it in tests or in some further computation.
>>
>> But this is exactly what I cannot do with this stupid doubling of  
>> double quotes
>>
>> (but if you use TDD test are already written ;P).
>>
>> well...
>>
>> Another one is to copy the result and paste it somewhere as a comment  
>> in your code, to access it easily afterwards. If you have a double  
>> quote in your result it will break the comment, so the thing is escaped  
>> automatically.
>>
>> Probably but here this is inside a string.
>> I think that this heuristic is totally bogus.
>>
>>
>> Uko
>>
>>> On 23 Feb 2017, at 22:25, stepharong <[hidden email]> wrote:
>>>
>>> Thnkas gabriel
>>> I'm hacking in an old Pharo 50 image and it was terrible because  
>>> printit even a copyReplaceAll: '""' byt: '"'
>>> did not work.
>>> I do not understand what is the scenario to double quote comment  
>>> character "
>>>
>>> I understand single quotes but not double quotes.
>>> stef
>>>
>>> Try doing Ctrl+P twice. It will not comment the printed string.
>>>
>>> On Thu, Feb 23, 2017 at 4:17 PM, stepharong <[hidden email]> wrote:
>>> about quoting ;(
>>>
>>> Hi
>>>
>>> I have a string
>>>
>>>  '<li>
>>> <span class="author">St&eacute;phane Ducasse and Damien Pollet</span>,  
>>> <span class="title">Fingerprints</span>, <span class="journal">Journal  
>>> of Information System</span>, <span class="year">2010</span>.
>>> </li>
>>> '
>>>
>>> and when I do printIt in the debugger I get the following
>>>
>>>
>>>  "'<li>
>>> <span class=""author"">St&eacute;phane Ducasse and Damien  
>>> Pollet</span>, <span class=""title"">Fingerprints</span>, <span  
>>> class=""journal"">Journal of Information System</span>, <span  
>>> class=""year"">2010</span>.
>>> </li>
>>> '"
>>>
>>> I do not get why we doublequote the character "
>>> inside string.
>>>
>>> It means that I have to remove all the " inside to string to be able  
>>> to express tests.
>>>
>>> Stef
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Using Opera's mail client: http://www.opera.com/mail/
>>
>>
>>
>>
>> --
>> Using Opera's mail client: http://www.opera.com/mail/
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "Innovation comes in the least expected form.
> That is, if it is expected, it already happened."
>
>


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

Reply | Threaded
Open this post in threaded view
|

Re: Why do we have doublequoting for "?

Tudor Girba-2
Hi Stef,

I think you are saying that having the possibility of embedding the printout as a comment is useless. But, there were people that wanted exactly that behavior without breaking the syntax highlighting. Esteban was one of them, for example.

And now we have Cmd+p,Cmd+p which does exactly what the old Cmd+p did.

What is missing?

Doru


> On Feb 26, 2017, at 10:33 PM, stepharong <[hidden email]> wrote:
>
> To me it looks wrong and it breaks flow. The poor guys working on XML should just suicide with such
> behavior. You can never print anything decently.
> I think that the tools are hijacking printString and turn it into something mega strange and bogus.
> I cannot even use plain Pharo code to survive.
> copyReplaceAll: '""' byt: '"'
>
> Stef
>
>> Hi Stef,
>>
>> Just a clarification.
>>
>> The mechanism you mention is obtained through Cmd+p, Enter and this embeds the printout as a comment in the existing editor. This is particularly useful when you want to keep a trace of multiple executions in the same editor (typically a Playground). In order to make any string a valid Pharo comment we use String>>asComment, and this escapes “ (double-quote) inside a comment. Without it, the result would not be a valid comment and the syntax highlighting would be broken.
>>
>> For your goal of having the result in the debugger this is obviously not ideal. This is why we ended up with Cmd+p,Cmd+p, but this is not available in Pharo 5.
>>
>> Cheers,
>> Doru
>>
>>
>>> On Feb 24, 2017, at 8:30 AM, stepharong <[hidden email]> wrote:
>>>
>>> Yuriy
>>>
>>>
>>> Why does it make sense to have "" "" inside strings?
>>>
>>>
>>> So if you paste this as a comment somewhere you don’t have to manually add double double-quotes.
>>>
>>> Did you read my example?
>>> I do not need any double double quotes.
>>>
>>>
>>> I don’t use the result of print it at all, but I guess there are two scenarios for it’s usage. One as you described: copy the result and use it in tests or in some further computation.
>>>
>>> But this is exactly what I cannot do with this stupid doubling of double quotes
>>>
>>> (but if you use TDD test are already written ;P).
>>>
>>> well...
>>>
>>> Another one is to copy the result and paste it somewhere as a comment in your code, to access it easily afterwards. If you have a double quote in your result it will break the comment, so the thing is escaped automatically.
>>>
>>> Probably but here this is inside a string.
>>> I think that this heuristic is totally bogus.
>>>
>>>
>>> Uko
>>>
>>>> On 23 Feb 2017, at 22:25, stepharong <[hidden email]> wrote:
>>>>
>>>> Thnkas gabriel
>>>> I'm hacking in an old Pharo 50 image and it was terrible because printit even a copyReplaceAll: '""' byt: '"'
>>>> did not work.
>>>> I do not understand what is the scenario to double quote comment character "
>>>>
>>>> I understand single quotes but not double quotes.
>>>> stef
>>>>
>>>> Try doing Ctrl+P twice. It will not comment the printed string.
>>>>
>>>> On Thu, Feb 23, 2017 at 4:17 PM, stepharong <[hidden email]> wrote:
>>>> about quoting ;(
>>>>
>>>> Hi
>>>>
>>>> I have a string
>>>>
>>>> '<li>
>>>> <span class="author">St&eacute;phane Ducasse and Damien Pollet</span>, <span class="title">Fingerprints</span>, <span class="journal">Journal of Information System</span>, <span class="year">2010</span>.
>>>> </li>
>>>> '
>>>>
>>>> and when I do printIt in the debugger I get the following
>>>>
>>>>
>>>> "'<li>
>>>> <span class=""author"">St&eacute;phane Ducasse and Damien Pollet</span>, <span class=""title"">Fingerprints</span>, <span class=""journal"">Journal of Information System</span>, <span class=""year"">2010</span>.
>>>> </li>
>>>> '"
>>>>
>>>> I do not get why we doublequote the character "
>>>> inside string.
>>>>
>>>> It means that I have to remove all the " inside to string to be able to express tests.
>>>>
>>>> Stef
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Using Opera's mail client: http://www.opera.com/mail/
>>>
>>>
>>>
>>>
>>> --
>>> Using Opera's mail client: http://www.opera.com/mail/
>>
>> --
>> www.tudorgirba.com
>> www.feenk.com
>>
>> "Innovation comes in the least expected form.
>> That is, if it is expected, it already happened."
>>
>>
>
>
> --
> Using Opera's mail client: http://www.opera.com/mail/

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

"Every now and then stop and ask yourself if the war you're fighting is the right one."





Reply | Threaded
Open this post in threaded view
|

Re: Why do we have doublequoting for "?

stepharong


> Hi Stef,
>
> I think you are saying that having the possibility of embedding the  
> printout as a comment is useless. But, there were people that wanted  
> exactly that behavior without breaking the syntax highlighting. Esteban  
> was one of them, for example.
>
> And now we have Cmd+p,Cmd+p which does exactly what the old Cmd+p did.

I was hacking on citezen in Pharo 50.
Now I have the impression that printIt is bogus. Its semantics is a hack  
and it feels like
it each time you get to the limit.
We would have the same bgus behavior if we would have  
printAsGraphicsRepresentation.
Now we overuse textual representation and breaks the underlying repl.

Now what I see is that I have to edit by hand long boring stupid XML  
because I cannot use printIt to get
a textual representation that is not trying to be too smart and failing on  
me.

Look for my remark on asLiteralOn:

Ste


> What is missing?
>
> Doru
>
>
>> On Feb 26, 2017, at 10:33 PM, stepharong <[hidden email]> wrote:
>>
>> To me it looks wrong and it breaks flow. The poor guys working on XML  
>> should just suicide with such
>> behavior. You can never print anything decently.
>> I think that the tools are hijacking printString and turn it into  
>> something mega strange and bogus.
>> I cannot even use plain Pharo code to survive.
>> copyReplaceAll: '""' byt: '"'
>>
>> Stef
>>
>>> Hi Stef,
>>>
>>> Just a clarification.
>>>
>>> The mechanism you mention is obtained through Cmd+p, Enter and this  
>>> embeds the printout as a comment in the existing editor. This is  
>>> particularly useful when you want to keep a trace of multiple  
>>> executions in the same editor (typically a Playground). In order to  
>>> make any string a valid Pharo comment we use String>>asComment, and  
>>> this escapes “ (double-quote) inside a comment. Without it, the result  
>>> would not be a valid comment and the syntax highlighting would be  
>>> broken.
>>>
>>> For your goal of having the result in the debugger this is obviously  
>>> not ideal. This is why we ended up with Cmd+p,Cmd+p, but this is not  
>>> available in Pharo 5.
>>>
>>> Cheers,
>>> Doru
>>>
>>>
>>>> On Feb 24, 2017, at 8:30 AM, stepharong <[hidden email]> wrote:
>>>>
>>>> Yuriy
>>>>
>>>>
>>>> Why does it make sense to have "" "" inside strings?
>>>>
>>>>
>>>> So if you paste this as a comment somewhere you don’t have to  
>>>> manually add double double-quotes.
>>>>
>>>> Did you read my example?
>>>> I do not need any double double quotes.
>>>>
>>>>
>>>> I don’t use the result of print it at all, but I guess there are two  
>>>> scenarios for it’s usage. One as you described: copy the result and  
>>>> use it in tests or in some further computation.
>>>>
>>>> But this is exactly what I cannot do with this stupid doubling of  
>>>> double quotes
>>>>
>>>> (but if you use TDD test are already written ;P).
>>>>
>>>> well...
>>>>
>>>> Another one is to copy the result and paste it somewhere as a comment  
>>>> in your code, to access it easily afterwards. If you have a double  
>>>> quote in your result it will break the comment, so the thing is  
>>>> escaped automatically.
>>>>
>>>> Probably but here this is inside a string.
>>>> I think that this heuristic is totally bogus.
>>>>
>>>>
>>>> Uko
>>>>
>>>>> On 23 Feb 2017, at 22:25, stepharong <[hidden email]> wrote:
>>>>>
>>>>> Thnkas gabriel
>>>>> I'm hacking in an old Pharo 50 image and it was terrible because  
>>>>> printit even a copyReplaceAll: '""' byt: '"'
>>>>> did not work.
>>>>> I do not understand what is the scenario to double quote comment  
>>>>> character "
>>>>>
>>>>> I understand single quotes but not double quotes.
>>>>> stef
>>>>>
>>>>> Try doing Ctrl+P twice. It will not comment the printed string.
>>>>>
>>>>> On Thu, Feb 23, 2017 at 4:17 PM, stepharong <[hidden email]>  
>>>>> wrote:
>>>>> about quoting ;(
>>>>>
>>>>> Hi
>>>>>
>>>>> I have a string
>>>>>
>>>>> '<li>
>>>>> <span class="author">St&eacute;phane Ducasse and Damien  
>>>>> Pollet</span>, <span class="title">Fingerprints</span>, <span  
>>>>> class="journal">Journal of Information System</span>, <span  
>>>>> class="year">2010</span>.
>>>>> </li>
>>>>> '
>>>>>
>>>>> and when I do printIt in the debugger I get the following
>>>>>
>>>>>
>>>>> "'<li>
>>>>> <span class=""author"">St&eacute;phane Ducasse and Damien  
>>>>> Pollet</span>, <span class=""title"">Fingerprints</span>, <span  
>>>>> class=""journal"">Journal of Information System</span>, <span  
>>>>> class=""year"">2010</span>.
>>>>> </li>
>>>>> '"
>>>>>
>>>>> I do not get why we doublequote the character "
>>>>> inside string.
>>>>>
>>>>> It means that I have to remove all the " inside to string to be able  
>>>>> to express tests.
>>>>>
>>>>> Stef
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Using Opera's mail client: http://www.opera.com/mail/
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Using Opera's mail client: http://www.opera.com/mail/
>>>
>>> --
>>> www.tudorgirba.com
>>> www.feenk.com
>>>
>>> "Innovation comes in the least expected form.
>>> That is, if it is expected, it already happened."
>>>
>>>
>>
>>
>> --
>> Using Opera's mail client: http://www.opera.com/mail/
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "Every now and then stop and ask yourself if the war you're fighting is  
> the right one."
>
>
>
>


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

Reply | Threaded
Open this post in threaded view
|

Re: Why do we have doublequoting for "?

Tudor Girba-2
Hi,

> On Feb 26, 2017, at 10:42 PM, stepharong <[hidden email]> wrote:
>
>
>
>> Hi Stef,
>>
>> I think you are saying that having the possibility of embedding the printout as a comment is useless. But, there were people that wanted exactly that behavior without breaking the syntax highlighting. Esteban was one of them, for example.
>>
>> And now we have Cmd+p,Cmd+p which does exactly what the old Cmd+p did.
>
> I was hacking on citezen in Pharo 50.
> Now I have the impression that printIt is bogus. Its semantics is a hack and it feels like
> it each time you get to the limit.
> We would have the same bgus behavior if we would have printAsGraphicsRepresentation.
> Now we overuse textual representation and breaks the underlying repl.

I agree that we overuse textual representation. For a long time we were conditioned by the fact that the editor was the central piece and that it only supported text. We will soon not have that limitation though. Let’s see what we can make of it.

> Now what I see is that I have to edit by hand long boring stupid XML because I cannot use printIt to get
> a textual representation that is not trying to be too smart and failing on me.
> Look for my remark on asLiteralOn:

I am still looking for it, but I did not find it yet :).

Doru


> Ste
>
>
>> What is missing?
>>
>> Doru
>>
>>
>>> On Feb 26, 2017, at 10:33 PM, stepharong <[hidden email]> wrote:
>>>
>>> To me it looks wrong and it breaks flow. The poor guys working on XML should just suicide with such
>>> behavior. You can never print anything decently.
>>> I think that the tools are hijacking printString and turn it into something mega strange and bogus.
>>> I cannot even use plain Pharo code to survive.
>>> copyReplaceAll: '""' byt: '"'
>>>
>>> Stef
>>>
>>>> Hi Stef,
>>>>
>>>> Just a clarification.
>>>>
>>>> The mechanism you mention is obtained through Cmd+p, Enter and this embeds the printout as a comment in the existing editor. This is particularly useful when you want to keep a trace of multiple executions in the same editor (typically a Playground). In order to make any string a valid Pharo comment we use String>>asComment, and this escapes “ (double-quote) inside a comment. Without it, the result would not be a valid comment and the syntax highlighting would be broken.
>>>>
>>>> For your goal of having the result in the debugger this is obviously not ideal. This is why we ended up with Cmd+p,Cmd+p, but this is not available in Pharo 5.
>>>>
>>>> Cheers,
>>>> Doru
>>>>
>>>>
>>>>> On Feb 24, 2017, at 8:30 AM, stepharong <[hidden email]> wrote:
>>>>>
>>>>> Yuriy
>>>>>
>>>>>
>>>>> Why does it make sense to have "" "" inside strings?
>>>>>
>>>>>
>>>>> So if you paste this as a comment somewhere you don’t have to manually add double double-quotes.
>>>>>
>>>>> Did you read my example?
>>>>> I do not need any double double quotes.
>>>>>
>>>>>
>>>>> I don’t use the result of print it at all, but I guess there are two scenarios for it’s usage. One as you described: copy the result and use it in tests or in some further computation.
>>>>>
>>>>> But this is exactly what I cannot do with this stupid doubling of double quotes
>>>>>
>>>>> (but if you use TDD test are already written ;P).
>>>>>
>>>>> well...
>>>>>
>>>>> Another one is to copy the result and paste it somewhere as a comment in your code, to access it easily afterwards. If you have a double quote in your result it will break the comment, so the thing is escaped automatically.
>>>>>
>>>>> Probably but here this is inside a string.
>>>>> I think that this heuristic is totally bogus.
>>>>>
>>>>>
>>>>> Uko
>>>>>
>>>>>> On 23 Feb 2017, at 22:25, stepharong <[hidden email]> wrote:
>>>>>>
>>>>>> Thnkas gabriel
>>>>>> I'm hacking in an old Pharo 50 image and it was terrible because printit even a copyReplaceAll: '""' byt: '"'
>>>>>> did not work.
>>>>>> I do not understand what is the scenario to double quote comment character "
>>>>>>
>>>>>> I understand single quotes but not double quotes.
>>>>>> stef
>>>>>>
>>>>>> Try doing Ctrl+P twice. It will not comment the printed string.
>>>>>>
>>>>>> On Thu, Feb 23, 2017 at 4:17 PM, stepharong <[hidden email]> wrote:
>>>>>> about quoting ;(
>>>>>>
>>>>>> Hi
>>>>>>
>>>>>> I have a string
>>>>>>
>>>>>> '<li>
>>>>>> <span class="author">St&eacute;phane Ducasse and Damien Pollet</span>, <span class="title">Fingerprints</span>, <span class="journal">Journal of Information System</span>, <span class="year">2010</span>.
>>>>>> </li>
>>>>>> '
>>>>>>
>>>>>> and when I do printIt in the debugger I get the following
>>>>>>
>>>>>>
>>>>>> "'<li>
>>>>>> <span class=""author"">St&eacute;phane Ducasse and Damien Pollet</span>, <span class=""title"">Fingerprints</span>, <span class=""journal"">Journal of Information System</span>, <span class=""year"">2010</span>.
>>>>>> </li>
>>>>>> '"
>>>>>>
>>>>>> I do not get why we doublequote the character "
>>>>>> inside string.
>>>>>>
>>>>>> It means that I have to remove all the " inside to string to be able to express tests.
>>>>>>
>>>>>> Stef
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Using Opera's mail client: http://www.opera.com/mail/
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Using Opera's mail client: http://www.opera.com/mail/
>>>>
>>>> --
>>>> www.tudorgirba.com
>>>> www.feenk.com
>>>>
>>>> "Innovation comes in the least expected form.
>>>> That is, if it is expected, it already happened."
>>>>
>>>>
>>>
>>>
>>> --
>>> Using Opera's mail client: http://www.opera.com/mail/
>>
>> --
>> www.tudorgirba.com
>> www.feenk.com
>>
>> "Every now and then stop and ask yourself if the war you're fighting is the right one."
>>
>>
>>
>>
>
>
> --
> Using Opera's mail client: http://www.opera.com/mail/

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

"Yesterday is a fact.
 Tomorrow is a possibility.
 Today is a challenge."





Reply | Threaded
Open this post in threaded view
|

Re: Why do we have doublequoting for "?

stepharong
I hate my mail client....
Apparently I wrote email to explain what I finally understood and it never  
sent it nor archive it :(
So I will try to summarize it and take some time tomorrow to reexplain it.

Now I understand why I got confused

printit is currently a function from
        objects -> literals (this handles the self-evaluating objects) + (and  
this is unfortunate non literals such as string objects by opposition to  
literal strings)

It means that there ares case where we can have
        object -> a string object (and not a literal) in that case we use the  
string object as a mediocre "reference" to the object.


If we would have
        printgraphics
                we would have objects -> graphics and unknow objects would be  
represented by a little blue square and clicking on it would bring
                and object representation (inspectors or whatever)

Now how to we improve the situation. I have the impression that it would  
be good to have instead of printOn: which is used to do too many things.

- first printOn: should not be used for list/combo or any widgets (this  
will avoid some friends I know to get interfaces with ' inside their  
comboxchoice) but to use displayString

- second I would introduce
        asLiteralOn:
        which garantee that you cannot escape
       
        this way printIt will only prints strings as literal strings and the  
contract is clear.
       
        objects -> literals (this handles the self-evaluating objects)
       
                1
                >>> 1

                false
                >>>
                false

                but
                (Directory name: 'comics')
                >>> 'comics'

                { 1 . Browser new}
                >>> 'anArray with (1, a Browser')

                now we can ask ourselves if

                {  (Directory name: 'comics') }
                >>>
                { 'comics' } I do not like it
                or
                >>> 'anArray with ( comics )
       

back to my confusion:

I was confused about the fact that I was hijacking the textual  
representation
        'comics' is not a directory but a string
        now may be I should have return a storeOn: representation
        or 'aDirectory (comics)'

        and introduce displayString
        'comics'

Probably that printOn: should not be used the way I did it.
but I do not know.

I think that this is a subtle domain and we should provide better  
guidelines.

Do you understand my points?
What do you think?

Stef

Reply | Threaded
Open this post in threaded view
|

Re: Why do we have doublequoting for "?

Tudor Girba-2
Hi Stef,

I am still thinking about this point, but I do not have an intelligent answer yet. I just wanted to say that I did not forget it :).

Cheers,
Doru


> On Feb 26, 2017, at 11:16 PM, stepharong <[hidden email]> wrote:
>
> I hate my mail client....
> Apparently I wrote email to explain what I finally understood and it never sent it nor archive it :(
> So I will try to summarize it and take some time tomorrow to reexplain it.
>
> Now I understand why I got confused
>
> printit is currently a function from
> objects -> literals (this handles the self-evaluating objects) + (and this is unfortunate non literals such as string objects by opposition to literal strings)
>
> It means that there ares case where we can have
> object -> a string object (and not a literal) in that case we use the string object as a mediocre "reference" to the object.
>
>
> If we would have
> printgraphics
> we would have objects -> graphics and unknow objects would be represented by a little blue square and clicking on it would bring
> and object representation (inspectors or whatever)
>
> Now how to we improve the situation. I have the impression that it would be good to have instead of printOn: which is used to do too many things.
>
> - first printOn: should not be used for list/combo or any widgets (this will avoid some friends I know to get interfaces with ' inside their comboxchoice) but to use displayString
>
> - second I would introduce
> asLiteralOn:
> which garantee that you cannot escape
>
> this way printIt will only prints strings as literal strings and the contract is clear.
>
> objects -> literals (this handles the self-evaluating objects)
>
> 1
> >>> 1
>
> false
> >>>
> false
>
> but
> (Directory name: 'comics')
> >>> 'comics'
>
> { 1 . Browser new}
> >>> 'anArray with (1, a Browser')
>
> now we can ask ourselves if
>
> {  (Directory name: 'comics') }
> >>>
> { 'comics' } I do not like it
> or
> >>> 'anArray with ( comics )
>
>
> back to my confusion:
>
> I was confused about the fact that I was hijacking the textual representation
> 'comics' is not a directory but a string
> now may be I should have return a storeOn: representation
> or 'aDirectory (comics)'
>
> and introduce displayString
> 'comics'
>
> Probably that printOn: should not be used the way I did it.
> but I do not know.
>
> I think that this is a subtle domain and we should provide better guidelines.
>
> Do you understand my points?
> What do you think?
>
> Stef

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

"Presenting is storytelling."


Reply | Threaded
Open this post in threaded view
|

Re: Why do we have doublequoting for "?

stepharong
On Sat, 11 Mar 2017 17:17:19 +0100, Tudor Girba <[hidden email]>  
wrote:

> Hi Stef,
>
> I am still thinking about this point, but I do not have an intelligent  
> answer yet. I just wanted to say that I did not forget it :).

:)


>
> Cheers,
> Doru
>
>
>> On Feb 26, 2017, at 11:16 PM, stepharong <[hidden email]> wrote:
>>
>> I hate my mail client....
>> Apparently I wrote email to explain what I finally understood and it  
>> never sent it nor archive it :(
>> So I will try to summarize it and take some time tomorrow to reexplain  
>> it.
>>
>> Now I understand why I got confused
>>
>> printit is currently a function from
>> objects -> literals (this handles the self-evaluating objects) + (and  
>> this is unfortunate non literals such as string objects by opposition  
>> to literal strings)
>>
>> It means that there ares case where we can have
>> object -> a string object (and not a literal) in that case we use the  
>> string object as a mediocre "reference" to the object.
>>
>>
>> If we would have
>> printgraphics
>> we would have objects -> graphics and unknow objects would be  
>> represented by a little blue square and clicking on it would bring
>> and object representation (inspectors or whatever)
>>
>> Now how to we improve the situation. I have the impression that it  
>> would be good to have instead of printOn: which is used to do too many  
>> things.
>>
>> - first printOn: should not be used for list/combo or any widgets (this  
>> will avoid some friends I know to get interfaces with ' inside their  
>> comboxchoice) but to use displayString
>>
>> - second I would introduce
>> asLiteralOn:
>> which garantee that you cannot escape
>>
>> this way printIt will only prints strings as literal strings and the  
>> contract is clear.
>>
>> objects -> literals (this handles the self-evaluating objects)
>>
>> 1
>> >>> 1
>>
>> false
>> >>>
>> false
>>
>> but
>> (Directory name: 'comics')
>> >>> 'comics'
>>
>> { 1 . Browser new}
>> >>> 'anArray with (1, a Browser')
>>
>> now we can ask ourselves if
>>
>> {  (Directory name: 'comics') }
>> >>>
>> { 'comics' } I do not like it
>> or
>> >>> 'anArray with ( comics )
>>
>>
>> back to my confusion:
>>
>> I was confused about the fact that I was hijacking the textual  
>> representation
>> 'comics' is not a directory but a string
>> now may be I should have return a storeOn: representation
>> or 'aDirectory (comics)'
>>
>> and introduce displayString
>> 'comics'
>>
>> Probably that printOn: should not be used the way I did it.
>> but I do not know.
>>
>> I think that this is a subtle domain and we should provide better  
>> guidelines.
>>
>> Do you understand my points?
>> What do you think?
>>
>> Stef
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "Presenting is storytelling."
>


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