unsure about bag abstraction

Oct 26, 2012 at 10:49am

unsure about bag abstraction

Hi there,

recently I created a stupid little extension of the bag object I’m using in several occasions (and with different contents) within one big patch. I called it “bag+”, and it does what I thought a bag object might do. But I’m no programmer, and a doubt makes me uneasy: if I use this abstraction with a bag object in it, can I be sure that every instance contains the different things it’s supposed to contain, or may they all share the same content?

Here’s what I’m speaking about:

– Pasted Max Patch, click to expand. –


Oct 26, 2012 at 10:59am

Oh, and I nearly forgot: I’d've liked to create the kind of hint you get with official objects when you pass the mouse over its in- and outputs (you know, those flashy explanations in dark gray bubbles). I only found the hints and annotations in the inspector window, but they’re less cool. As you can see in the patch above, I tried to imitate those hints with bubble comments, but they’re static. So, is it possible to create those hints also for your personal objects?

Oct 26, 2012 at 2:39pm

Ok, I answer myself at least the last question (maybe it’s useful for somebody else): it’s possible to have comments on in- and outlets of abstractions. You have to open the actual abstraction, click on an in- or outlet and then open the inspector. There you can add a comment. That’s nice!

Oct 26, 2012 at 2:58pm


“… can I be sure that every instance contains the different things it’s supposed to contain …”

Concerning [bag] : yes.

Oct 26, 2012 at 4:46pm

ok, thanks! But this answer seems as if other content containing objects, maybe [coll], [histo], or [funbuff] would eventually share their contents if used inside an abstraction. Is there something I (and surely other users) should know?


Oct 26, 2012 at 5:13pm


For objects that can be named (as [coll], [funbuff], [table]…) the contents can be sometimes shared between abstractions (open the reference to get exact behavior). A tip to force those objects to be local to an abstraction is to use #0 at the beginning of the name (e.g. [coll #0_foo]). Search in the forum, there is a bunch of thread about that.

Oct 26, 2012 at 6:41pm

I see ! Thank you for this info.


You must be logged in to reply to this topic.