hi again,
...why all this is so important? I have just introduced an 'embedding' feature to cyclone's coll and funbuff. 'Embedding' here means storing the state of a collection object in a patch file, just like it can be the case with Pd arrays.
Implementing it properly right from the start is important, because otherwise there is a risk of future upheavals -- most importantly of making .pd files incompatible with newer, corrected versions of the library.
Currently I am using the 'save' method stored in a class' 'widgetbehavior'. The sequence stored in a .pd file is:
#X obj... -- the same line as usual #C... -- embedding stuff, possibly multiple #C lines #C restore;
The #C symbol (read: 'contents'), apparently not used elsewhere, is bound to an object being created. The 'restore' line takes care of the unbinding.
Now, since the first line in the sequence is a valid creation message on its own, I have to find other way of distinguishing loading from a .pd file (and pasting) -- when the full sequence is always executed, including the final 'restore' -- from other cases (without 'restore').
Ok, there is a whole bunch of other dilemmas: how to plug the 'save' method into text object's widgetbehaviour? why to plug it at all, and not use the 'saveto' method, instead? -- but I do not want to flood the list with more spam...
help, Krzysztof
Btw, my current code does the job, but it is horrible, and likely to be broken by any new Pd release...