Hi Julian,

I think this is a bug in expr code. Incidentally I just recently noticed it as well. I have not had a chance to find the bug yet, but as a work around if you add spaces before and after the variables that have the $0, your patch should open fine.  I am listing your patch below which I edited accordingly and it opens fine. Let me know if you are still seeing a problem.

Cheers,
Shahrokh

#N canvas 950 538 450 300 12;

#N canvas 961 878 744 300 something 1;

#X floatatom 302 68 5 0 0 0 - - -;

#X floatatom 517 67 5 0 0 0 - - -;

#X obj 67 35 inlet~;

#X obj 87 98 fexpr~ if((CR_\$0 > HT_\$0) \, CG_\$0 = $f3* CG_\$0 + (1-$f3)*$x1 \, 0) \; if((CA_\$0 > HT_\$0) \, CG_\$0 = $f2* CG_\$0 + (1-$f2)*$x1 \,

0), f 62;

#X connect 0 0 3 1;

#X connect 1 0 3 2;

#X connect 2 0 3 0;

#X restore 88 89 pd something;

#X obj 250 59 v CG_\$0;

#X obj 83 46 noise~;

#X obj 252 95 v CA_\$0;

#X obj 248 131 v CR_\$0;

#X connect 2 0 0 0;







On Sun, Jul 19, 2020 at 5:08 PM <pd-list-request@lists.iem.at> wrote:
Send Pd-list mailing list submissions to
        pd-list@lists.iem.at

To subscribe or unsubscribe via the World Wide Web, visit
        https://urldefense.com/v3/__https://lists.puredata.info/listinfo/pd-list__;!!Mih3wA!Qjzha_s4GuePW0RPaxcXWPGtEn1p9tKU220rAT-4XVc7bjH5RjIsmM7sIIF_$
or, via email, send a message with subject or body 'help' to
        pd-list-request@lists.iem.at

You can reach the person managing the list at
        pd-list-owner@lists.iem.at

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Pd-list digest..."


Today's Topics:

   1. fexpr and dollar zero weirdness (Julián Villegas)


----------------------------------------------------------------------

Message: 1
Date: Mon, 20 Jul 2020 08:57:24 +0900
From: Julián Villegas <villegas.julian@gmail.com>
To: pd-list@lists.iem.at
Subject: [PD] fexpr and dollar zero weirdness
Message-ID: <E5F4A1BC-CDD9-4950-B20A-E4371A6E6D1B@gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi list,

I have a program that uses [fexpr~] and values ending in $0, similar to the program in the attachment.
When I create the program, it works just as intended. I then save it and close Pd, but when I open the program again some of the “$0" are replaced  by “_\$0” breaking the program (as in the pdf I’m also sending, but I’m not sure if you would be able to see it). I can easily edit it again, but every time I reopen the program I have to do the same.

I’m using Pd 0.51.0 on macOS 10.15.5 (Catalina). Am I doing something wrong? is this a bug?

Additionally, I also have problems when open programs in two different screens: I connect my laptop to a larger screen since my eyes are not so good anymore. If I edit the program in the large screen and save it, next time I try to open it, Pd crashes even before opening the patch.
By reading the Pd patch on a text editor, I have detected that this is caused by negative coordinates given to the canvas. I can easily change those by “0” and the program opens again correctly. Is this something I should report as a bug? the thing is that I don’t have a reproducible examples and I think this is highly dependent on the screen setup. However, may be making sure that canvases are not saved with negative coordinates could fix the problem.


Thank you for your advice,


Julian.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: dollar0weirdness.pd
Type: application/octet-stream
Size: 519 bytes
Desc: not available
URL: <https://urldefense.com/v3/__http://lists.puredata.info/pipermail/pd-list/attachments/20200720/f480a8c0/attachment.obj__;!!Mih3wA!Qjzha_s4GuePW0RPaxcXWPGtEn1p9tKU220rAT-4XVc7bjH5RjIsmJ0yKB6x$ >
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2020-07-17 at 16.08.32 PM.pdf
Type: application/pdf
Size: 81544 bytes
Desc: not available
URL: <https://urldefense.com/v3/__http://lists.puredata.info/pipermail/pd-list/attachments/20200720/f480a8c0/attachment.pdf__;!!Mih3wA!Qjzha_s4GuePW0RPaxcXWPGtEn1p9tKU220rAT-4XVc7bjH5RjIsmHKmFt25$ >

------------------------------

Subject: Digest Footer

_______________________________________________
Pd-list mailing list
Pd-list@lists.iem.at
to manage your subscription (including un-subscription) see
https://urldefense.com/v3/__https://lists.puredata.info/listinfo/pd-list__;!!Mih3wA!Qjzha_s4GuePW0RPaxcXWPGtEn1p9tKU220rAT-4XVc7bjH5RjIsmM7sIIF_$


------------------------------

End of Pd-list Digest, Vol 184, Issue 36
****************************************


--
Shahrokh Yadegari
Professor, Music Department
University of California, San Diego
Director, Sonic Arts R&D and IDEAS
Qualcomm Institute
Email: sdy@ucsd.edu
Web: http://yadegari.org