[PD] Hide backslash escapes in symbol atoms

Christof Ressi info at christofressi.com
Thu Nov 18 18:40:05 CET 2021


I completely agree with Roman here.

The space character in a list box has a different function than in a 
symbol box.

In a symbol box it will always be part of the symbol. Also, it can be 
typed as is. I really don't see a need to display the escape character 
here. On the contrary, I often use symbol boxes to display strings, and 
I find this behavior quite irritating.

In a list box, a space is used to seperate atoms. If you want to embed a 
space in one of the symbol atoms, you explicitly have to type "\ ". 
Unsurprisingly, the escape character is also displayed. The same thing 
applies to message boxes. There is a semantic difference between an 
ordinary space and an escaped space.

I think we could apply a simple rule: display what the user has typed.

Christof

On 18.11.2021 18:33, Roman Haefeli wrote:
> On Thu, 2021-11-18 at 12:26 -0300, Alexandre Torres Porres wrote:
>> I remember that discussion (I can try and find it) and I remember
>> people agreed symbol box should hide "\".
>>
>> I guess I can agree to that. In my idea, we know what's coming out of
>> a symbol box, it's a symbol, so if you have a symbol with a space,
>> then we know that the space is 'escaped' (that is, we're not
>> splitting this into two atoms).
> Yeah, it definitely should keep the symbol intact. But that to make
> sure is an issue of the FUDI encoding. I don't type backslash escapes
> and I also do not want them to be displayed. The backslashes are not
> part of the payload, unless I type them explicitly.
>
>> But I think print should keep it, in the same way we also need to
>> keep it for message boxes.
>>
>> Outside the context of a symbol box, it is important to differentiate
>> if we have, for instance, a list where one of the items contains an
>> escaped space.
>>
>> like, the message:
>>
>> | list one\ item two <
>>
>> has two atoms "one item" and "two", and print should be able to tell
>> us that.
> Yeah, that's the FUDI encoding of a list containing two symbols.
>
>
>> Now, I don't know about the new list box. What if we want to create a
>> list with an escaped space? It seems like a special and
>> different case/context of a symbol box.
> Yeah, obviously list boxes are for lists and symbol boxes for symbols.
> I think for list boxes to be effective they need to show the FUDI
> encoded value, which means displaying the escaping character.
>
>>   By the way, I've been testing it and it seems we can do this by
>> putting the escaped character ourselves. That seems correct. But it
>> would be different than the symbol box and maybe I guess it shouldn't
>> be too problematic that the symbol box also shows escaped characters.
> Yes, it is, imho, it is dead-ugly and confuses the distinction between
> payload and encoding. I'm pretty happy that Python doesn't only print
> "b'Z\xc3\xbcrich'" when I intend to print "Zürich".
>
>> They're not that common and we can document why this happens when it
>> happens.
> That would be confusing things even more.
>
> Roman
>
> _______________________________________________
> Pd-list at lists.iem.at  mailing list
> UNSUBSCRIBE and account-management ->https://lists.puredata.info/listinfo/pd-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20211118/e84598aa/attachment.htm>


More information about the Pd-list mailing list