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

Andy Farnell padawan12 at obiwannabe.co.uk
Wed Aug 3 23:45:24 CEST 2011





On Wed, 3 Aug 2011 17:12:49 -0400
Hans-Christoph Steiner <hans at at.or.at> wrote:

> 
> 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."


That seems unambiguous. So I guess if you wanted your "numbers" as 
symbols, you'd explicitly convert them back to symbols. 

I used to use [symbol2list] a lot, so Iohannes suggestion
is interesting. But could that split on an arbitary 
symbol like Chris suggests for the proposed [split] ?

a.

-- 
Andy Farnell <padawan12 at obiwannabe.co.uk>



More information about the Pd-list mailing list