This is a basic question, I know, but I can't find if it's definitively documented anywhere:
Clearly the dollar-sign substitution works in an abstraction such as
[something $1-foo $2-bar(
instantiating myabs like this...
[myabs 1 2(
... will instantiate "something" with the arguments "1-foo" and "2-bar". Ok, so what if the values I really want to instantiate "something" with are "foo-1" and "bar-2"? This....
[something foo-$1 bar-$2(
... doesn't seem to work - or does it? I seem to remember reading somewhere that dollarsign substitutions like that only work at the beginning of values - but can't find where I read that.
So if this is the case, has anyone come up with any clever way of hacking around it, so that I *can* do what I'm talking about here?
Thanks, and sorry if this is documented somewhere, I just can't find it...
Best,
Hallo, david daniell hat gesagt: // david daniell wrote:
This is a basic question, I know, but I can't find if it's definitively documented anywhere:
Clearly the dollar-sign substitution works in an abstraction such as
[something $1-foo $2-bar(
I take it that you actually mean [something $1-foo $2-bar], as [this( notation is more common for messages, whereas [that] describes objects.
- for instance, if that's in an abstraction called "myabs", then
instantiating myabs like this...
[myabs 1 2(
... will instantiate "something" with the arguments "1-foo" and "2-bar". Ok, so what if the values I really want to instantiate "something" with are "foo-1" and "bar-2"? This....
[something foo-$1 bar-$2(
... doesn't seem to work - or does it? I seem to remember reading somewhere that dollarsign substitutions like that only work at the beginning of values - but can't find where I read that.
You probably read it in the html manual which everyone (hopefully) reads first.
It is true. You won't get dollar-expansion when the dollar symbols aren't at the start.
So if this is the case, has anyone come up with any clever way of hacking around it, so that I *can* do what I'm talking about here?
No, you cannot do as you describe above. But depending on what you actually want to achieve, there are alternate ways with getting what you want by using [makefilename]. There is no way to expand object arguments when the $x is not at the beginning.
There is no such thing as a dollar variable defined in Pd anywhere else except at the front of a symbol (which could be empty, too).
Frank Barknecht _ ______footils.org__
Frank Barknecht said:
[something $1-foo $2-bar(
I take it that you actually mean [something $1-foo $2-bar], as [this( notation is more common for messages, whereas [that] describes objects.
oops, yeah, you're right. shouldn't have written this before my first cup of coffee...
You probably read it in the html manual which everyone (hopefully) reads first.
thanks - i couldn't find it in the .pd documentation, didn't think to pull out that html manual again.
No, you cannot do as you describe above. But depending on what you actually want to achieve, there are alternate ways with getting what you want by using [makefilename]. There is no way to expand object arguments when the $x is not at the beginning.
ah right, like this:
[loadbang] | [int $1] | [makefilename foo-$d]
then rather than use that as a creation argument i'd have to send it as a message to the place where i need it. this would be sufficient for me though. thanks for the pointer.
-d