[PD] dollarsign substitution clarification

Frank Barknecht fbar at footils.org
Tue Jul 6 17:05:04 CEST 2004

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

> - 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__

More information about the Pd-list mailing list