From 2927ce68c3528be6f5cc9ded0499a4d2423b3309 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 8 Apr 2004 16:50:47 +0000 Subject: added some more examples svn path=/trunk/externals/zexy/; revision=1578 --- examples/lister.pd | 69 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 23 deletions(-) (limited to 'examples') diff --git a/examples/lister.pd b/examples/lister.pd index d6f3e45..66dd74e 100644 --- a/examples/lister.pd +++ b/examples/lister.pd @@ -1,23 +1,46 @@ -#N canvas 83 390 771 524 10; -#X obj 160 14 lister; -#X text 210 15 - store a list; -#X msg 41 151 bang; -#X text 76 152 outputs a list; -#X text 257 196 sets and outputs a list; -#X text 307 239 sets a list; -#X text 214 263 creation argument initializes a list; -#X obj 41 303 print; -#X text 129 362 alias; -#X obj 169 362 l; -#X text 64 53 similar to the "float" \, "int" \, "symbol" \, ... objects; -#X msg 204 240 2 3 5 7 11 prime; -#X obj 41 262 lister 1 2 3 4 5 6 7 ordinal; -#X msg 62 197 1 1 2 3 5 8 13 21 44 fibonacchi; -#X text 64 77 of course \, this is similar to the "pack" object \, but here we handle list-lenghts dynamically and do not care about type checking !!!; -#X text 40 434 of course \, this should be named "list" \, but there already appears to be a "list" object \, though i don't see any use in it; -#X obj 434 443 list 1 two trois; -#X text 40 471 it seems to store 1 atom only; -#X connect 2 0 12 0; -#X connect 11 0 12 1; -#X connect 12 0 7 0; -#X connect 13 0 12 0; +#N canvas 194 86 685 518 10; +#X obj 110 16 lister; +#X text 160 17 - store a list; +#X msg 41 132 bang; +#X text 76 133 outputs a list; +#X text 288 180 sets and outputs a list; +#X text 243 336 creation argument initializes a list; +#X obj 18 381 print; +#X text 291 16 alias; +#X obj 331 16 l; +#X msg 232 315 2 3 5 7 11 prime; +#X obj 41 336 lister 1 2 3 4 5 6 7 ordinal; +#X msg 62 180 1 1 2 3 5 8 13 21 44 fibonacchi; +#X text 64 77 of course \, this is similar to the "pack" object \, +but here we handle list-lenghts dynamically and do not care about type +checking !!!; +#X text 40 434 of course \, this should be named "list" \, but there +already appears to be a "list" object \, though i don't see any use +in it; +#X obj 443 440 list 1 two trois; +#X text 40 473 it seems to store 1 atom only; +#X obj 67 381 list2symbol; +#X symbolatom 67 403 0 0 0 0 output: - -; +#X msg 91 260 one 2 3 four; +#X msg 96 283 list one 2 3 four; +#X text 228 283 works; +#X text 193 260 does NOT work (check console for error); +#X text 353 315 right inlet sets a list without outputting; +#X text 94 222 lists of mixed-type work but if any list starts with +a symbol \, you need to cast it as a list:; +#X msg 77 199 1 two three 4; +#X msg 51 161 7 8 9; +#X text 64 53 similar to:; +#X obj 154 52 float; +#X obj 202 52 int; +#X obj 237 52 symbol; +#X connect 2 0 10 0; +#X connect 9 0 10 1; +#X connect 10 0 6 0; +#X connect 10 0 16 0; +#X connect 11 0 10 0; +#X connect 16 0 17 0; +#X connect 18 0 10 0; +#X connect 19 0 10 0; +#X connect 24 0 10 0; +#X connect 25 0 10 0; -- cgit v1.2.1