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

Martin Peach martin.peach at sympatico.ca
Sat Sep 10 17:20:11 CEST 2011


On 2011-09-10 01:57, Mathieu Bouchard wrote:
> On Tue, 6 Sep 2011, martin.peach at sympatico.ca wrote:
>
>> Yes, I think it ought to be up to the external to implement its own
>> symbol-to-float converter since there is no universally valid way of
>> doing it. The same pattern will have different meanings in different
>> context and Pd can't be expected to know what is expected in a
>> specific case.
>
> Give examples...
>
> Which other ways are you thinking about, apart from something that
> behaves more or less like strtof ?
>

OK, for example an object that converts names of numbers to floats:

[one two three(
|
[nametof]
|
1.0 2.0 3.0

or binary to float:

[b101010{
|
[btof]
|
42.0

or imaginary numbers:

[5+3i(
|
[itof]
|    |
5.0  3.0

or even some kind of [expr] that takes symbolic input:

[atan{.007)(
|
[sexpr]
|
0.40106

None of the above would work properly with a default symbol-to-float 
method. Each needs to parse its input according to its own specific 
meaning-space.

Martin



More information about the Pd-list mailing list