[PD-dev] $0 in messages, was: multiple $arg-expansion

Mathieu Bouchard matju at artengine.ca
Mon Jan 16 06:22:07 CET 2006


On Sun, 15 Jan 2006, IOhannes m zmoelnig wrote:

> however, i think that "$0" is a bad name. i would have liked it better
> if $0 was the selector (in messages)

I agree. It's especially nice as most anythings are accepted by 
messageboxes (except those starting by methodnames of messageboxes such 
as "set").

Yesterday at PureData Montréal 16, someone wrote $0 in a messagebox and
printed it. It was garbage because the output wasn't a valid t_symbol*.
He was expecting it to output the selector.

> and the classname (in abstractions).

I agree that it should be the classname in order to be consistent with 
the above use of messageboxes, and because it's very intuitive: if you 
write [foo 42 bar] then $0 should be foo just like $1 is 42 and $2 is bar.

> probably "$$" would have been better for a uniq id (well, i know that
> this is a bashism (its the process-id in bash), but that is not
> necessarily bad)

I would have preferred "$$" too. That slashed S symbol called "dollar" is
a mnemonic in several languages, for a word that starts with S: in BASIC
it meant String, in Perl it means Scalar, in Ruby it might mean Special 
(because Sglobal isn't quite a word). In Bash, Tcl and Pd it means 
Substitution. Possibly that "$$" could be remembered as Substitute Self.

> 2nd thing todo (LATER!) is a mechanism for stacked $args, like ${$1-2}

What does that mean?

 _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
| Freelance Digital Arts Engineer, Montréal QC Canada




More information about the Pd-dev mailing list