[OSC_dev] floats vs. ints, how to deal
James McCartney
asynth at io.com
Sat Mar 3 11:17:13 PST 2007
On Feb 11, 2007, at 9:26 PM, Ross Bencina wrote:
> Hi Steve
>
> Interesting problem. As far as I know, OSC doesn't say much about
> this. But personally I think Pd is at least partly wrong -- it
> should probably allow the user to pass a type tag string as a
> parameter.... but chuck should be able to handle messages with ints
> in them too..
>
> My take on things is that the reciever should be the one who fixes
> the type signature of the message, and the sender should conform to
> this (same logic as for function calls in statically typed
> languages like C, C++, Java etc). Implicit type coercion has never
> been part of the OSC spec, so the idea that the reciever will
> convert numeric types doesn't sit well with me. There's also the
> possibility for "overloaded" messages where the semantics are
> dependent on the type signature.
>
> Cheers
>
> Ross.
OK I'm a little late on this, but to me the problem is not with Pd.
The point of type tags is to identify to the receiver the type of the
value sent. It is up to the receiver to do a conversion based on the
tag - string integers and floats can all be converted to each other.
The interface should be as polymorphic as possible. For the receiver
to only accept floats is like those web forms that won't accept
spaces or dashes in phone or credit card numbers. lazy programmer!
--- james mccartney
More information about the OSC_dev
mailing list