[Csnd] Orchestra Macros and Multiline Strings
Date | 2021-01-02 18:35 |
From | Joseph Hughes |
Subject | [Csnd] Orchestra Macros and Multiline Strings |
Does anyone here know the rules about using orchestra macros within multi line strings ( {{...}} )? I'm not getting the output I would expect. Here's an example: #define EXAMPLE(ARG_1) # prints {{ Here I expect to see the value of ARG_1 but instead I get the following: }} prints {{$ARG_1}} prints {{%n%n}} prints {{ A dollar sign in a string block returns the name of the parent macro: }} prints {{$}} prints {{%n%n}} # $EXAMPLE(test) The output for the above is:
Are there rules around multiline strings and macros that I'm unaware of? Thanks for your time, everyone. |
Date | 2021-01-02 23:21 |
From | Pete Goodeve |
Subject | Re: [Csnd] Orchestra Macros and Multiline Strings |
Attachments | None |
Date | 2021-01-03 16:58 |
From | Joseph Hughes |
Subject | Re: [Csnd] Orchestra Macros and Multiline Strings |
Thanks for trying it out, Pete. I found the same thing. Regular double-quote strings interpret macros the way I would expect. It's only the double-bracket strings that have this problem. On Sat, Jan 2, 2021 at 6:21 PM Pete Goodeve <pete.goodeve@computer.org> wrote: Experimenting, I see that: |
Date | 2021-01-03 17:02 |
From | Dave Seidel |
Subject | Re: [Csnd] Orchestra Macros and Multiline Strings |
Sounds like a good candidate for a new ticket at https://github.com/csound/csound/issues On Sun, Jan 3, 2021 at 11:58 AM Joseph Hughes <joehughesmail@gmail.com> wrote:
|
Date | 2021-01-03 17:26 |
From | john |
Subject | Re: [Csnd] Orchestra Macros and Multiline Strings |
There is no attempt to expand macros inside {{}} strings. This was in the original design, and is not a bug. This would be an incompatible change so we need to be sure that is what we want. On a technical issue this is not straightforward and could take smre time to get right. ==Jon ff > On Sat, Jan 2, 2021 at 6:21 PM Pete Goodeve |
Date | 2021-01-03 18:43 |
From | Pete Goodeve |
Subject | Re: [Csnd] Orchestra Macros and Multiline Strings |
Attachments | None |
Date | 2021-01-04 19:54 |
From | Joseph Hughes |
Subject | Re: [Csnd] Orchestra Macros and Multiline Strings |
I see how the documentation as written implies that there should be no macro expansion within bracket strings. I guess if there's a bug here at all it's that the '$' does get replaced with an unexpected result in bracket strings defined within macros. On Sun, Jan 3, 2021 at 1:43 PM Pete Goodeve <pete.goodeve@computer.org> wrote: If it's a 'feature', it would be nice to have it documented! (:-)) |