On Fri, 2011-09-09 at 15:05 +0200, Frank Barknecht wrote:
Hi,
On Wed, Sep 07, 2011 at 02:13:01PM -0400, Hans-Christoph Steiner wrote:
About hex 0x form, that could conceivably fall under the "anything that looks like a number is a float", as least for programmers.
I really disagree with your assumption, that in Pd, "anything that looks like a number is a float". This is simlpy not how Pd works or is programmed, it's not in the manual [1] and [makefilename %d] proves the opposite is true: Some symbols can indeed look a lot like numbers. I think, your wrong premise leads to wrong conclusions and should be reconsidered.
[1] Here are some occurrences of you premise:
- "Anything that is not a valid number os considered a symbol."
appears in "2.1.2. object boxes" and talks about object boxes.
"2.3.1. anatomy of a message" "The selector is a symbol, which appears in the patch as a non-numeric string with no white space, semicolons, or commas". Note the "appears in a patch", which again hints at the well-known "feature" of the editor to convert things that look like numbers to floats.
Same chapter: "It is possible to type messages which start with a number, which cannot be used as a selector." Note the "type".
How would you then describe how Pd judges the difference between a symbol and a float? I wish there was more on this topic in the manual, but there is not. As for your quoted sentence, context is key here, its talking about the implied float and list selectors:
"It is possible to type messages which start with a number, which cannot be used as a selector. A single number is always given the "float" selector automatically, and a message with a number followed by other arguments is given the selector "list"."
And indeed, if I was only going on what the manual said, it would be a very weak argument. Mostly, I'm going on how the type system works. You can directly interface the automatic typing of atoms by adding arguments in an object or message box. It is not currently possible to generate a "456" symbol by typing something into a message or object box. And [makefilename %d] was added many years after the initial type system was implemented (especially if you consider Max) http://lists.puredata.info/pipermail/pd-list/1999-10/000765.html so it is also not representative of the type system.
More importantly: how should it act to be useful. Obviously [makefilename %d] is useful. That's why I just posted those [symbol2] and [float2] objects on this thread. I think these two objects show that we can add conversion between symbols and floats without negatively impacting anything else. Please test them and let me know what you think. I think these can replace the built-in [symbol] and [float].
.hc