Syntax correct but Bach isn't executing (hidden characters?)

Discussions, advice, bug reports and much more about the "bach" environment.
Post Reply
sydy
Posts: 155
Joined: Tue Mar 21, 2017 1:34 pm

Syntax correct but Bach isn't executing (hidden characters?)

Post by sydy » Thu Sep 03, 2020 4:57 pm

Dear Daniele, Dear Andrea,

Sometimes I use a syntax but Bach doesn't execute it.
This is not the first time it happens to me.
Here you have a very simple example reproducing this phenomena. It can't be a bug but I can't track the problem. I suppose there are hidden characters...

THANKS in advance for your help – it drives me already crazy. :–)

Micha
<pre><code>
----------begin_max5_patcher----------
1613.3oc6bstbahCE921OEL7aucQhKFu+aeNxjwiLHGqFgDCHGGuc56ReV5S
1pKXLXDttFW2zDbR.rtcz4Se5Hc.N4KSm3th+Jtz04ebdvYxjuLcxDcRpDlT
88ItYnWSnnRcwbWsUH3L2YlrXayHLJVnyCbLQ9VwooRR00mu5y+EX9g5miJP
YXAtXIlgVQwph3UkmoMD6ywl9m6JD6IWmGqqpHYCg8zxBbhvTBvh3O4MyA3o
NBCNbz4QUM95zopCytm5YzuF8Lx6lolL7NYO8P2TfeUKBWgC0Y0OgxCsn7At
8oftyt7Ay.sV5uPqkvqTKyvkknmvcTyRL0AQoybvEnRbIkKb7sp0vKdH2ues
9bZKbdjRCiA5QVn2fT2egCpvgMnZXtAU7Wu+TFTAW2fJH.b6FTS3YYXln6n5
FRoCmgcXbwOwfqWW0bga+pR.PyOAQ5IhfPit38qRW1wKdtzYXpS7YTGXrgBB
C+T3vUm9XhnzTM86AG+u+sGbj8C4J.LGHPlRxVriTZpep6mE3RIpfDDNaIkv
vI7sLwIL0qf9Fckr2pUSizmfFBvMe1ZCLxoOH56e6wgMAN75PfnljjgB.qPI
a9TYBunFCdgSRjaGH6vFvbePYC8wicoVJ67pDSwqQaoB4rcsssC0kskROVy0
blP0xZI+uEDD00JVsnwvQBmxKLslVuOd.nTYKlEqItDIzgSIhBo8er0NjVWK
yQID0JD0x.F0noUc50njyu4HEDct+ZuDzK3hR4rIoRuB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bO3TU2bZeHv.wGy9j9EE+BlVYg.zscZlc6opf+Nn9
5K7MQIxaQjebfNtHMHUcrXzcJVIOCKTQWRc+86eqU+26jy22t9nzOQ5sSr+.
yoNh+dvAzJJyzUwsQ7GcHnyzgYjJ81gdVIeaQxgXl5PL26bLPiRkyPILiOyM
JTfoPVCusKVRQWhjf2BIEbARJ5VIHvORk.2BIAu.UJ7VIn6iJAtD9vMPPQ2I
4DdUxwLCFkmWEShZgnDgb0uOaB7x3Y5uRXlupC8P4ZouPNT9PcJnhjMx8kkH
1VXBvyWiL+uVvUsszB1Vht1SUJmTj5PPUGlo4UAWoNRUm90o+OX1fNGF
-----------end_max5_patcher-----------
</code></pre>

danieleghisi
Site Admin
Posts: 1347
Joined: Fri Dec 03, 2010 1:25 pm

Re: Syntax correct but Bach isn't executing (hidden characters?)

Post by danieleghisi » Fri Sep 04, 2020 12:06 am

I am away from keyboard, but when that happens to me in bach.expr or eval it is usually hard-spaces instead of spaces.
If that doesn't solve it, I'll look into it tomorrow.

sydy
Posts: 155
Joined: Tue Mar 21, 2017 1:34 pm

Re: Syntax correct but Bach isn't executing (hidden characters?)

Post by sydy » Fri Sep 04, 2020 8:05 am

Thanks. Daniele
Oh, my gosh now I see. My (Swiss) keyboard needs alt to create [ ] . But a hard space is also created by alt+space. So actually hardspaces are easy to produce in a max environment. Quite dangerous and good know.

danieleghisi
Site Admin
Posts: 1347
Joined: Fri Dec 03, 2010 1:25 pm

Re: Syntax correct but Bach isn't executing (hidden characters?)

Post by danieleghisi » Fri Sep 04, 2020 10:29 am

I agree that it is error prone. That is however true for every Max object:

<pre><code>
----------begin_max5_patcher----------
223.3ocWPtkCBCBDE8aXUP36pos9HpaEiwPqSULVngBZSL5Zw0hqLYFrwD+Y
H2yvcdcmyjU1AnWJ1H1JXr6bFiPHf8Uyjspg5Kpd5aRCbyVcVlkR4gAOgqBM
Mf646WMVqnLeLu9.kM5XRwHyDZ0lKfmpW9OnM3+m1o70mzli6cPsOMkk4kSy
yDEKWiOqlgwxHRrCs7fywfXWr.RUW2Uv0qsFZevsItKmsNTtJijZSRVPRGbU
O9+EDQ4hCfO18fCnUYX4bYxp8.3LAM4lGaJ1R5NYTsPempNY.Om7G7O.bWUV
qC
-----------end_max5_patcher-----------
</code></pre>

To me the delicate part is within bach.eval's code: in that case hard spaces are sometimes hard to spot.

sydy
Posts: 155
Joined: Tue Mar 21, 2017 1:34 pm

Re: Syntax correct but Bach isn't executing (hidden characters?)

Post by sydy » Sun Sep 06, 2020 8:12 am

Dear Daniele,

You're totally right – and thanks anyway for your answer. I'm already glad that I really know now what a hard space is and that this problem exists.
Indeed you're right it most dangerous in Bach.eval where you might be in the middle of a longer snippet and then have a total confusion because the syntax looks right but because of the hard spaces the problem is hidden.

As we're so lucky to have bell in atom (thanks ANDREA). There's a nice little solution which I just found in the great atom packages :
https://atom.io/packages/highlight-nbsp
It highlights – wonderfully – the hard spaces or (seems like there also called No-break spaces ).

BTW, I love the authors statement: "With this package you'll easily notice annoying invisible character and save yourself of the burden to debug code for hours."
I felt suddenly less alone :D

best,
micha

Post Reply