[PD] (breaking symbols) was Re: find a list of numbers in a text file

Hans-Christoph Steiner hans at at.or.at
Wed Aug 3 23:12:49 CEST 2011


On Aug 3, 2011, at 3:29 PM, Andy Farnell wrote:

> On Wed, 3 Aug 2011 14:21:09 +0800
> Chris McCormick <chris at mccormick.cx> wrote:
>
>> Would you consider adding a more generally useful [split] object
>
> I agree this would be a useful core object.
>
> What problems, if any, do you forsee?
>
> Would those outputs implicitly be symbols? Or would we venture
> the types in advance like
>
> [split f / f]
>
> to obtain two floats
>
> Turning the symbol 5/7 to a real number
> would then be
>
> [symbol 5/7(
> |
> [split f / f]
> |    /
> [/  ]
> |
> [number 0.714285]


I think to fit with the Pd type system in general, it should  
automatically interpret things into floats and symbols (http://puredata.info/dev/PdDefinitions 
):

  Pd Manual 2.1.2

"The text is divided into atoms separated by white space."

"Atoms are either numbers or symbols like '+'. "

Pd Manual 2.1.2

"Anything that is not a valid number is considered a symbol."

.hc


----------------------------------------------------------------------------

As we enjoy great advantages from inventions of others, we should be  
glad of an opportunity to serve others by any invention of ours; and  
this we should do freely and generously.         - Benjamin Franklin





More information about the Pd-list mailing list