Just being a bit pedantic here:
I know that $0-sends won't work in messages
It's not that $0
doesn't work in messages, it's more that dollar signs have different functions when used with objects and messages. When using them with objects, $1
, $2
, $3
, etc. are creation arguments of the object. In the case of an abstraction, you can call these creation arguments by using [f $1], [f $2], [f $3], etc. The [f $0] is a special case: $0
is a unique number generated for each subpatch and abstraction, so that you can have several instances of a same abstraction and yet have an automatic way of distinguishing between them (useful when creating local sends and receives or tables, among other things).
When it comes to messages, $1
, $2
, $3
, etc. refer to the values of a list received by the message. For instance, if you send a message [0 1 1000( to [$1, $2 $3(, you are effectively attributing $1 -> 0, $2 -> 1 and $3 -> 1000. These are not creation arguments, but rather work as simple variables. This is the reason $0 makes no sense inside a message. On the other hand, if you must have the value [f $0] inside a message, you can do the following trick:
[loadbang]
|
[f $0]
|
[$1(
So that $1
gets substituted by the first value of a list arriving, in which case would consitute only of the single value $0
.
Hope this helps,
Gilberto