----- Original Message ----- > From: Mathieu Bouchard <[email protected]> > To: Jonathan Wilkes <[email protected]> > Cc: Chris McCormick <[email protected]>; Miller Puckette <[email protected]>; > "[email protected]" <[email protected]> > Sent: Saturday, September 3, 2011 1:20 PM > Subject: Re: [PD] (breaking symbols) was Re: find a list of numbers in a text > file > > On Wed, 31 Aug 2011, Jonathan Wilkes wrote: > >> Keep in mind that [list implode] must be smart enough to output the float >> atom "12" given the input "49 50". If it gives you > "symbol 12" then your >> back to the [makefilename] madness from my original vanilla solution. > > It's not that simple.
It needs to be that simple for the general case because Pd Vanilla has no (sensible) mechanism to convert a symbol atom into a float. If symbol atoms which look like numbers to the naked eye are going to start flying around more freely in Pd then the docs need to explain how atoms are a kind of weird file cabinet where the label on the cabinet tells you which file-folder inside actually holds the data. So if you send the symbol-atom "15" to [max], the file clerk will complain because it's looking for a number but the label on the cabinet says "A_SYMBOL". (Additionally, if you tell the clerk to ignore the label and just pull out a number, the clerk will look in "A_FLOAT" and give you a "0", because the "15" is in the "A_SYMBOL" file-folder.) Hm... is there a way you can tell the clerk to be a real go-getter when looking for a float atom inside a cabined labeled "A_SYMBOL" by just going ahead and seeing if the data in the "A_SYMBOL" file-folder looks like a number, and if so convert it to a float and send it on its way? Also, I'm assuming [list implode] would accept and process a list at the left inlet, unlike [s2l] (which passes the 1st element to the right inlet). > People might not want always a cast to float, because > then, it might destroy part of the information in the symbol. > > see : > http://lists.puredata.info/pipermail/pd-list/2006-09/042419.html > > that's how [gf/s2l] is different : it outputs only symbols. I think I could > make it an option, but I wouldn't know how to call it. E.g. : > > [gf/s2l /, docast] > [gf/s2l /, convert] > [gf/s2l /, atof] > > where the name after the comma is an attribute method taking one optional > float > arg defaulting to 1, just like all other flags in GF, defined like this : > > \attr bool docast; > > void cast_if_wanted (t_atom *foo) {if (docast) ........;} > > _______________________________________________________________________ > | Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC > _______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
