Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote: > Hallo, > Max Neupert hat gesagt: // Max Neupert wrote: > > > is there something like a [change] but for lists and symbols? > > For symbols this is easy to do, see attached version. Lists are a bit > more work though.
Actually it doesn't seem too hard. Attached is an experimental new list-abs abstraction (name bound to change) which compares two lists, searches for equal elements and spits out a number indicating how many elements in the left-inlet list are found in the right-inlet list as well. With a length-comparison this could be made to something like a [list-equal] and then form the base for list change. The files require some abstractions from [list]-abs. Ciao -- Frank Barknecht _ ______footils.org_ __goto10.org__
#N canvas 157 8 536 557 10; #X obj 281 145 list; #X obj 304 46 inlet; #X obj 195 182 list-dripslow; #X obj 76 119 list-drip; #X obj 76 147 t a b; #X obj 76 343 select DUMMY; #X msg 195 286 symbol \$1; #X msg 76 284 symbol \$1; #X obj 134 462 f; #X obj 134 519 outlet; #X obj 76 40 inlet; #X msg 173 345 0; #X obj 76 61 t a b b; #X obj 173 424 f; #X obj 201 424 + 1; #X connect 0 0 2 1; #X connect 1 0 0 1; #X connect 2 0 6 0; #X connect 3 0 4 0; #X connect 3 1 8 0; #X connect 4 0 7 0; #X connect 4 1 2 0; #X connect 5 0 13 0; #X connect 6 0 5 1; #X connect 7 0 5 0; #X connect 8 0 9 0; #X connect 10 0 12 0; #X connect 11 0 13 0; #X connect 12 0 3 0; #X connect 12 1 11 0; #X connect 12 2 0 0; #X connect 13 0 8 1; #X connect 13 0 14 0; #X connect 14 0 13 1;
#N canvas 0 0 604 365 10; #X msg 121 96 1 2 3 4; #X floatatom 97 215 5 0 0 1 number_of_equal_elements - -; #X msg 97 51 a b c d; #X obj 97 134 list-equal-elements; #X msg 109 74 a b 3 4; #X msg 249 101 1 2 3 4; #X msg 225 56 a b c d; #X msg 237 79 a b 3 4; #X obj 130 165 print; #X msg 256 125 1 2 3 4 5; #X text 333 127 careful!; #X obj 407 196 list-len; #X obj 391 245 ==; #X obj 391 266 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1; #X obj 331 214 list-len; #X connect 0 0 3 0; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 3 0 8 0; #X connect 4 0 3 0; #X connect 5 0 3 1; #X connect 5 0 11 0; #X connect 6 0 3 1; #X connect 7 0 3 1; #X connect 9 0 3 1; #X connect 9 0 11 0; #X connect 11 0 12 1; #X connect 12 0 13 0; #X connect 14 0 12 0;
_______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
