[PD] bang vs empty list

IOhannes m zmoelnig zmoelnig at iem.at
Thu Feb 28 10:20:39 CET 2013


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

On 2013-02-26 02:17, Jonathan Wilkes wrote:
> Seems like for any object that doesn't have a bang method nor list
> method, an empty list silently gets discarded.
[...]
> 
> Is there a way to fix this?
> 

sure :-)

the default list method will try to do something clever with the empty
list:
- - if there is a non-default bangmethod, it will call that (which is
not the case for [sin])
- - elif there is a non-default catchall method, it will call that
(which is not the case for [sin])
- - elif the object has inlets (which is the case for [sin]), it will
distribute the atoms over the inlets. since there are 0 atoms, no
inlet will receive any data.
- - else call the default catchall method.

so i think there are two things to fix:
1. Pd shouldn't try to fill an empty list to the objects inlets.
2. [t a] should not output an empty list if it receives a [bang(

attached are fixes for both problems (actually the 2nd patch makes [t
a] output the message as it came in, rather than converting it to a
list - so it also fixes the problem for numbers and symbols, not only
for bangs)
i rely on the community to test them thorougly :-)

there are still some weirdos though:

[float 42, list 666, list, foo(
|
[t s]
|
[print]

i wonder what the correct behaviour should actually be.
intuitively i would say that for non-symbols, [t s] should output the
selector as a symbol (if we don't want to introduce "%d" semantics
which i would rather not for performance reasons).
this would also make sense for anythings, where we currently get that
weird "only convert 's' to 'b' or 'a'" (it's weird insofar as it takes
some time to see what the 's' is referring to)

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

iEYEARECAAYFAlEvIWQACgkQkX2Xpv6ydvROxQCcCySUREYwDdUEAQwkHpq/oSVX
TJUAoMxAjB4wZwUGy+QiOAoSwY2o7xLF
=56Tj
-----END PGP SIGNATURE-----


More information about the Pd-list mailing list