so I guess Roman's solution [0( -> [;pd-sub obj 0 0 array define $$1-snd0( is just fine as long as you only want to create all those arrays once and don't care if the "creator" part isn't saved correctly.
BTW, my solution works for plain dollarargs ("$1") but it doesn't work properly for dollarsymbols ("$1-foo"). that's where my confusion came from...
Gesendet: Dienstag, 15. Mai 2018 um 14:31 Uhr Von: "Ingo Stock" mail@ingostock.de An: pd-list@lists.iem.at Betreff: Re: [PD] Fw: Re: Escaping/not resolving dollar argts in msgs/objects?
With both solutions the $ in the created arrays are escaped like [array define $0-snd0] and cannot be accessed by [array get $0-snd0].
On 05/15/2018 02:22 PM, Christof Ressi wrote:
sorry, I think I misread your question. for what you want Jack's solution is right. mine is for dynamically creating patch *files*.
Gesendet: Dienstag, 15. Mai 2018 um 14:09 Uhr Von: "Christof Ressi" christof.ressi@gmx.at An: "Roman Haefeli" reduzent@gmail.com Cc: pd-list@lists.iem.at Betreff: Re: [PD] Escaping/not resolving dollar argts in msgs/objects?
[obj 20 20 array define $$1-snd0]
this only works as long as you don't save and reopen the patch, where "$$1" will become "$$1" (which is resolved to "$\$1" instead of "\$1").
this should do the trick: [0( --> [makefilename $%d] --> [;pd-mysubpatch obj 0 0 array define $1-snd0(
one case where this is necessary is when you dynamically create pd patch files which take creation arguments or need $0-symbols.
Christof
Gesendet: Dienstag, 15. Mai 2018 um 13:52 Uhr Von: "Roman Haefeli" reduzent@gmail.com An: pd-list@lists.iem.at Betreff: Re: [PD] Escaping/not resolving dollar argts in msgs/objects?
On Tue, 2018-05-15 at 04:15 -0700, Derek Kwan wrote:
Hello list,
Perhaps a bit of a long shot and pretty much the exact opposite of the $0 in messages conversations as of late: Is there a way to NOT resolve dollar arguments in messages and/or objects?
I think you cannot dynamically disable the resolution of dollar symbols.
Example case: Lately for a project I've wanted to create vast swaths of [array define]s and I've done so with dynamic patching. Since I want their bound symbols to be something like "$0-snd0", "$0-snd1" $0"-snd2"... "$0-snd50", I DON'T want dollar arguments (particularly the $0) to resolve to anything
Do I understand correctly that you want to be able to create those objects containing literal '$0'?
You can "trick" Pd into creating a symbol that itself has a dollar variable:
[0 ( | [obj 20 20 array define $$1-snd0] | [s canvas]
. Similarly, I store filepath + array symbol pairs in texts to do a big load at the beginning and for right now and can always add the $0-bit via passing that symbol through a [makefilename], but I'm wondering if I can pass $0s unresolved into a text without having to manually type it in via the popup window.
You could use the same trick.
Of course I can always edit the patch in emacs/vim and do a search/replace, but I'm looking for an in-Pd solutions... Also for the array business I suppose I could do that via [clone], but that situation doesn't seem ideal either...
I was just wondering why I haven't ever experienced the same need for literal dollar symbols in my patching career and realized that I never save dynamically created stuff. I rather let the dynamic stuff be created each time I load the patch. This way all dollar variables resolve to the currently correct value and I never bothered to use literal dollar signs in dynamic patching. Maybe I'm not fully understanding your case, but I can't see how having dynamically generated '$0' is useful in any way. Either you create all dynamic stuff from scratch, then you can as well use the value of $0 or you're saving stuff for later, but why do you need $0 then? Don't you rather want something fixed/controllable, that evaluates to the same value on each run?
Roman
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list