On Sun, 6 Jul 2008, Martin Peach wrote:
...but isn't 'list' a selector as well? What is special about it apart from the existence of list methods in Pd? Couldn't one use outlet_anything for lists as well?
List messages are special because in plain Pd, there is no list atomtype, but there is a wish to take a list as being one datatype. At the same time, there is a need for messages that could be implemented as lists but that handle special functions. Therefore, anything() is the all-inclusive method for messages, and list() is a special case of anything() with s=&s_list. Other builtin selectors are special cases of list() even though they have a different selector, because that selector mutates automatically.
I think of the list-vs-anything distinction as being a good idea, while I tend to think of the selector mutation as being a bad idea, which could have been dealt with in several other ways (depending on other features that could have been dealt with differently), but this is largely theoretical, as we wouldn't be able to change it without having pd stop being pd.
It seems that outlet_list just prepends a 'list' selector to the rest of the atoms,
Yes, it's just a call to anything() with an implicit s=&s_list ... outlet_float and such are a tiny bit more complex as they build a t_atom[1] on top of that.
and a list method on an inlet just strips it and passes the rest.
Actually, it does not even strip it. The function-pointer signature for class_addanything and class_addlist are the same.
i hope it makes sense.
I'm getting there;)
The origin of the concept of selector is the method-names in object-oriented language (it is called "selector" in several of those languages). For example, if you define a member function named "open" in C++, or use class_addmethod(...gensym("open")...), or use [route open] on a leftmost [inlet] and connect something to the left outlet, what it does is morally equivalent.
PS: For further confusion, [route open] does the wrong thing by default, as the resulting message doesn't have the same $1 anymore... it would make more sense to just replace the selector by &s_list and let the user do [list trim] if (s)he wants, given what one would most want to do with a [route] on an [inlet].
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec