On Fri, 18 Jun 2010, Roman Haefeli wrote:

I am probably the wrong person to comment on the technical aspects, but
it seems to me that your proposal of having only a setup() function
instead of the current classname_setup() function would render it
impossible to have a c file provide more than one class. Or am I
misunderstanding something here?

No. You can define any number of classes in a setup().

In fact, you can do anything. I once made a library that would only provide more aliases for existing (builtin) classes, so that I could instantiate either [inlet] or [inlet~] by writing [inlet.$1] where $1 was a parameter that could be f, s, ~, # or other.

You can also add methods to existing classes. Thus GridFlow adds methods "else", "last" and "last_activate" in the "canvas" class. It's very useful to do so, but Pd doesn't have a plan for documenting such a situation, because I can't provide a rightclick helpfile for the extra methods. So, for now, they are still undocumented, but they are used by [#in], [#many] and [doc_m] respectively, among other uses...

If you happen to have several files in a big library, and they each have a setup(), you can name each of the setups differently and call all of them from the main setup() of the library (except itself). If you need a library to be compilable in both manners from the same source, you can use compilation options such as -Dsetup=thisclass_setup or things like that, to rename a plain setup() to a longer, unique name.

 _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to