[PD] Turing Tarpit (was Re: (breaking symbols

IOhannes m zmölnig zmoelnig at iem.at
Tue Nov 25 19:38:12 CET 2014


On 11/24/2014 01:11 PM, Billy Stiltner wrote:
> 
> how in the world do I strip the symbol selector and
> send 50 and 40 to [/ ] as floats?

you don't want to "strip the selector". the selector is there to hint at
the type (at least in the case of 'float' and 'symbol'), but it cannot
change the type of the atom (symbol:'1' vs float:1).

what you do want is to convert a symbol into a number.

attached is a vanilla [symbol2int] implementation

i leave it as an exercise to the reader to turn it into a [symbol2float] :-)


gfdmsr
IOhannes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: symbol2int.pd
Type: text/x-puredata
Size: 1247 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20141125/12020d52/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20141125/12020d52/attachment.sig>


More information about the Pd-list mailing list