Le 2012-02-22 à 19:25:00, august a écrit :
The GObject method is pretty clever. It allows you to abstract objects in an XML format. Then, based on those abstractions, you can introspect them for their behaviour and link them into almost any language.
I wonder how difficult it would be to do something like that with PD's object system?
You can already inspect several aspects of Pd objects and classes, at runtime, without having to read any XML at all. However, this info is not especially complete : in particular, classes don't contain lists of methods for non-first inlets, and there is no class-table, only a constructor-table, so you need an object to be instantiated before you can access a class. Also, method signatures are often limited to A_GIMME for lack of ability to say it differently.
That's except for pd classes that go through GridFlow's C++ interface. In that case, there's a central class-table, from which you can find all method-names for all inlets. Method signatures (argument types) are not available but this feature could be added to the system without modifying any class. Each class also has a list of attributes, which gives you at least type info for *some* of the methods.
There are some other exceptions like that as well, having to do with various bridges between one language and Pd.
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC