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

Chris McCormick chris at mccormick.cx
Wed Aug 31 02:46:54 CEST 2011


Hi Miller,

On Tue, Aug 30, 2011 at 01:21:29PM -0700, Miller Puckette wrote:
> belated response...
> 
> how about 'list tosymbol' and 'list fromsymbol'?  I.e.
> 
> 98 97 116 -> bat -> 98 97 116

I don't think this would accomodate the same use-cases as zexy's [symbol2list] or the hypothetical [split]. It doesn't really help in the original ratio-parsing case which started this thread.

I was thinking more of:

(symbol) "this/is/my/path/symbol.txt" -> (list) "this" "is" "my" "path" "symbol.txt" -> (symbol) "this/is/my/path/symbol.txt"

Or in the ratios case cited:

"2/3" -> "2" "3" -> "2/3"

This would give it a great deal of general usefulness.

I am in favour of having that functionality as part of [list] and those names look good to me. For the functionality you describe maybe something like [list ascii2symbol] and [list symbol2ascii]? Those would also be pretty useful!

I am currently making a [split] abstraction based on Jamie's work. I will send it through when I am done - or you can just look at symbol2list's source which IOhannes has re-licensed in a message to this list for use in Pd:

<http://pure-data.svn.sourceforge.net/viewvc/pure-data/trunk/externals/zexy/src/symbol2list.c?revision=15284&content-type=text%2Fplain>

<http://pure-data.svn.sourceforge.net/viewvc/pure-data/trunk/externals/zexy/reference/symbol2list-help.pd?revision=15284>

"i hereby grant miller s. puckette (the authore of pure-data) the
right to use (and modify) the code of zexy's "symbol2list" objectn to
integrate it into puredata under the terms of the revised BSD license
under which puredata is currently distributed."

IOhannes - http://lists.puredata.info/pipermail/pd-list/2011-08/090184.html

Cheers,

Chris.

> On Wed, Aug 03, 2011 at 10:45:24PM +0100, Andy Farnell wrote:
> > 
> > 
> > 
> > 
> > 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>
> > 
> > _______________________________________________
> > Pd-list at iem.at mailing list
> > UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-------------------
http://mccormick.cx



More information about the Pd-list mailing list