-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-02-23 21:52, Hans-Christoph Steiner wrote:
It seems to me the way to really do this would be to have post() and logpost() find out the calling object instance on its own, if that's possible. Then it would automatically apply to all externals, which would be sweet.
i think this is partly possible (afair, maju had something like this in desiredata).
however, i imagine it will only work for objects which are triggered via messages (as Pd could track when a message enters an instance, and set a static variable to this instance)
otoh, it most likely won't work with objects triggered directly by t_clock events, it makes delegation hard (e.g. when creating an abstraction, you might want to appear a message to come from the abstraction itself, rather than from one of the objects inside of the abstraction...cf. iemgut's "pderror" object) and it will go havoc with multithreading (not that Pd properly supports multithreading; however, i'm a firm believer that global states are evil and we should try to generate as few "thread-unsafe-by-design" code)
finally, "post()" is sometimes used to printout messages that are not associated with an object at all. e.g., where do you want to jump to at "I/O error, audio stuck", or at "GEM: Authors : Mark Danks (original version)"
therefore i think it is a good idea to make the new logpost() behave similar to pd_error(), as it allows us to explicitely associate an object (of our choice!) with a message. since it might be a nice feature to have traditional "error" and "post" messages associated with an object, this functionality could be added for the sake of those old APIs
but let's not do automagic if there is no need at all.
fgmasdr IOhannes