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:
"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.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@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@obiwannabe.co.uk
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list