[Pharo-dev] Why do we have doublequoting for "?

stepharong stepharong at free.fr
Fri Feb 24 02:30:44 EST 2017


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  

> (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.

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 <stepharong at free.fr> 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 <stepharong at free.fr> wrote:
>>>> about quoting ;(
>>>> Hi
>>>> I have a string
>>>> '<li>
>>>> <span class="author">Sté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é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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20170224/8d327711/attachment.html>

More information about the Pharo-dev mailing list