[PD] Finding "$0" and dealing with it in messages

Mathieu Bouchard matju at artengine.ca
Fri Nov 13 21:38:32 CET 2009


On Fri, 13 Nov 2009, Roman Haefeli wrote:
> On Fri, 2009-11-13 at 18:08 +0100, IOhannes m zmoelnig wrote:
>>>> The only thing i don't really get: Why seems there some agreement, that
>>>> using $0 to get the selector could be confusing?
>> because i want to get the selector of an object-box as well (it's name).
> What the hell is the selector of an object box?

when an objectbox is created, its contents («binbuf») are $-evaluated as 
when a messagebox receives a message (but commas and semicolons are left 
untouched), and then the whole contents are sent to &pd_objectmaker as a 
message. therefore [moses 42] has receiver=&pd_objectmaker, 
selector=moses, $1=42.

The selector is the creator's name, which is usually the same as the 
class' name, but not always (because aliases are possible). The difference 
is mostly only visible in the default names of helpfiles. I often say that 
the classname is the selector, even though it's not technically true, 
because it's almost true (a damn lot more than calling it the objectname, 
anyway).

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801


More information about the Pd-list mailing list