[PD] put the argument of an abstraction in a message

IOhannes m zmoelnig zmoelnig at iem.at
Mon Oct 15 18:42:28 CEST 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2012-10-15 17:39, Charles Henry wrote:
> Just create an object [$1], send it a bang, and it dumps out the
> 1st argument of the abstraction it's in.

this really only works for floats.
if the user calls [myabs moses], [$1] will evaluate to [moses] which
will not dump it's name when banged.

> I use it this way for floats.  I think you need to declare it
> differently for strings/symbols.  How about [symbol $1]?


the generic solution for this is to use [list prepend $1]
it will output a float when you pass it a float and a symbol when you
pass it a symbol (to be precise, it will output a "list" message with
one atom (float or symbol), which will be interpreted by most objects
as the correct type)

fgamsdr
IOhannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlB8PPQACgkQkX2Xpv6ydvScHACfVp4JwMs/rYtV+q6t1S1ZKN3n
bvgAnA8a9EIuE5vA4BC0eANE8W0jrat6
=K4fP
-----END PGP SIGNATURE-----



More information about the Pd-list mailing list