Basic questions clarifications about --- and #0

Sonoran Music Devices's icon

Per the documentation:

The three dash (---) identifier is used for coll, dict, and in the context of Max for Live. It serves as a way to create unique names for objects. In the context of Max for Live, if you want a named object to be unique to a device, use three dashes (---) to start the name of your buffer or send/receive destination.

When the abstraction is used inside another patcher, an argument typed into the object box in the patcher replaces the # argument inside the abstraction. Using a zero with the pound sign (#0) at the beginning of a symbol argument (e.g., #0_value), transforms that argument into an identifier that is unique to each instance of an abstraction (and its subpatchers) when it is loaded.

Questions please:

  1. Can --- work for all objects, specifically arrays? It seems so, but I want to double check, as the documentation is ambiguous. I created a named array, which I access from multiple places in the same patcher, and I need that name to be local to that instance of the Max for Live device and not clash with other instances of the same device. It seems to work, but I want to double check. Without the ---, my devices crash, since they clash. With the ---, they do not crash.

  2. With abstractions in Max for Live, does --- still work as expected, or must I use #0? I have been using --- and not #0, and it seems to work fine, but I want to double check.

tyler mazaika's icon

With abstractions in Max for Live, does --- still work as expected, or must I use #0? I have been using --- and not #0, and it seems to work fine, but I want to double check.

Yes. The difference is ---foo will be the same value if you have multiple of the same abstraction in the same instance of the M4L device. #0foo is local to that particular instance of the abstraction.

Re: the first question, --- works for AFAIK every object I've used, it isn't specific to coll and dict. For instance [autopattr] patch names, [value], [send] / [receive] etc etc. You can just look at an [array] object in M4L context and see if the --- value gets translated into numbers.