On Oct 28, 2006, at 3:57 AM, Frank Barknecht wrote:
Hallo, Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:
A student just discovered this strange behavior. Basically, if you get something that generates a symbolic atom that has numeric data in it, you can then create a mystery type by feeding that thru [list trim]. Don't know exactly where the problem is, but something fishy is going on.
What "list trim" does on a "symbol X" is generate a meta message consisting only of the selector "X". But here this selector is numeric. Numeric selectors are illegal, because selectors have to be a symbol. It could be considered a bug in the patch trying to generate such illegal meta-messages. Removing the [list trim] will fix the patch as will adding a [list] after [list trim].
My guess is that [list trim] should output a float.
To me it is a bug in the patch rather than in [list trim]. In my understanding [list trim] is designed to remove the "list"-selector and through that the other two standard Pd selectors, "float" and "symbol" as well, but it was not designed to add them or to convert from "symbol ..." to "float ...". For that, [list] itself should be used.
Yes, this is a strange thing to do, but I am just illustrating a point. This problem came to my attention because of a real world problem where OSC from Flash is being received from Pd fine, but its generating this format of data, and it is therefore useless (without [atoi], which works correctly here, IMHO).
If this is a totally useless and illegal value, then nothing should ever generate it. By definition, anything that can be interrupted as a number, should be a float. The Pd manual 2.1.2 says "Anything that is not a valid number is considered a symbol" ("symbol" here meaning symbolic atom, not symbol message). That means that the converse should be true too: "anything that is a valid number should be considered a float".
Therefore any atom containing "1234" should always be a float.
.hc
------------------------------------------------------------------------
Access to computers should be unlimited and total. - the hacker ethic