[PD-dev] $0 in messages, was: multiple $arg-expansion

Frank Barknecht fbar at footils.org
Thu Jan 26 19:36:46 CET 2006


Hallo,
Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:

> >But with pd-0.39 this issue is solved thanks to the [list] object,
> >that automatically converts everything to a full-blown list-list, if
> >one is needed. This is another reason to upgrade to 0.39 soon, if
> >someone hasn't done so yet.
> 
> Sadly, this doesn't fix the problems [route] and [print] have with  
> lists.   See [pd has some odd cases of list handling] in  
> doc/pddp/all_about_lists_vs_anythings.pd

Maybe I'm just too used to the way lists and selectors work in Pd, but
I don't see where the problem with [route] is (I agree, that [print]
sucks.)

First: [prepend] is an external so it has its own rules and cannot be
an argument against the way, Pd handles selectors and lists .The Pd
object to use is [list prepend]. It always outputs list-lists. 

That takes care of two examples in the pddp-patch.

"one 2 three" vs. "list one 2 three": 

[route one] behaves correctly here. If one wants to get "2 three" as a
result for the second message, then one should use [list trim] in
front of route. Fixing the complaint in the pddp-patch actually would
make [route one] imply a [route list] or [list trim] internally which
is inconsistent and not always wanted so it's better to keep it
explicit with [list trim].


"1 two 3" vs. "list 1 two 3"

If one can accept that numbers can never be selectors, then the
automatic conversion of selector-less lists starting with a float to
list-lists is not unusual. And once it is accepted, that "1 two 3"
actually is *the same* as "list 1 two 3" in the same way, that "float
3.141" is the same as "3.141" I also don't see a real problem. 

The only possible difficulty is to understand, that "one 2 three" is
*not* the same as "list one 2 three" and that [route] thus will behave
differently here. 

The only case where I could follow the difficulties is the automatic
conversion of "list x" to "symbol x" in [route]. This is consistent
with converting "list 1" to "float 1" but of course is different from
the auto-conversion of "1" to "float 1" because "x" is not the same as
"symbol x" immediatly. 

However: In my view "list x" being equivalent to "symbol x" has
advantages in practice, because if after some operations you end up
with a list-list containing only one symbol, you probably want a
symbol actually. At least that is my experience.

Btw: While testing around some cases, I actually think I found a bug
in [select] which is illustrated in attached patch.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 280 293 477 434 10;
#X msg 339 111 symbol x;
#X obj 223 180 list;
#X obj 217 329 print miss;
#X obj 166 361 print hit;
#X obj 219 74 t b b b b;
#X msg 107 107 symbol x;
#X msg 223 110 x y;
#X msg 282 110 x;
#X msg 219 54 bang;
#X obj 166 298 select x;
#X msg 236 271 symbol x;
#X text 349 134 hit;
#X text 284 129 hit;
#X text 227 129 miss;
#X text 125 128 miss (sic!);
#X text 233 250 reset:;
#X connect 0 0 9 0;
#X connect 1 0 9 0;
#X connect 4 0 5 0;
#X connect 4 1 6 0;
#X connect 4 2 7 0;
#X connect 4 3 0 0;
#X connect 5 0 9 0;
#X connect 6 0 1 0;
#X connect 7 0 1 0;
#X connect 8 0 4 0;
#X connect 9 0 3 0;
#X connect 9 1 2 0;
#X connect 10 0 9 1;


More information about the Pd-dev mailing list