Hallo Roman, Roman Haefeli hat gesagt: // Roman Haefeli wrote:
Am 26.11.09 09:24 schrieb "Frank Barknecht" unter fbar@footils.org:
To me, it is not even clear, when data types are converted, in cases when conversion happens at all. Does it happen at the 'inlet', or the 'outlet'? at both?
I happens in between: Every Pd objectclass can define different methods for different kinds of messages coming in.
...
What an object produces on the outlet-side also is defined by the object: From an abstraction, you can send out bangs, symbols, meta-messages etc. Same with C-objects: There are Pd functions like outlet_float(), outlet_symbol(), outlet_anything() that an external's author can use to produce any kind of output. This includes the possibility to write objects that behave "strange" or inconsistent.
Ok, i see. If i understand right, this would also make it possible to deliberately create a message 'list 23' at the outlet, which is probably converted to a 'float 23' by the next object's outlet (_if_ this next object's inlet knows what to do with the selector 'list').
Ok, here you mention a different thing, which is the automatic conversion of "special" messages, i.e. "list 23" is just a "float 23" which is the same as "23", or "list" being the same as "bang".
I must admit, that I don't really know where and how this is happening in Pd. As you wrote, sometimes this conversion isn't working. A good example is the right (or non-leftmost) inlet of the signal math objects: If they are created so that normally both signals and floats can be sent into them, they only like "real" floats, that is messages with selector "float" or numbers. They won't accept messages coming out ot a [t a] either:
[0
|
[t a a]
| |
[*~ ]
This gives "error: inlet: expected 'signal' but got 'list'" on the right inlet. But if you disconnect the right inlet, the same "anything-float" is accepted on the first inlet.
Maybe IOhannes can explain the background? IIRC he wrote a patch that fixes this so that [t a] works for non-leftmost signal inlets as well.
Unfortunately, knowing this doesn't make me understand what happens here - for instance:
[list 23( | [print]
which produces simply '23' in the pd window. Now, does the message box object do some evaluation and effectively sends 'float 23' instead of 'list 23', or is the [print] that does some reformatting and treats single element lists as 'float' or 'symbol' messages?
Apart from the fact that [print] is a very bad helper in this case, I don't know where and how "list 23" is made to be 23, see above. :(
Frank