From 061e4be1f20ac78e3b52bc6429322d5fadcf5831 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 28 Apr 2005 00:25:05 +0000 Subject: cleaned up a number of patches; renamed all to the standard -help.pd format; added some more ideas to the style guide; finished up lists_vs_anythings svn path=/trunk/; revision=2841 --- doc/pddp/all_about_lists_vs_anythings.pd | 179 ++++++++++++++++++------------- 1 file changed, 106 insertions(+), 73 deletions(-) (limited to 'doc/pddp/all_about_lists_vs_anythings.pd') diff --git a/doc/pddp/all_about_lists_vs_anythings.pd b/doc/pddp/all_about_lists_vs_anythings.pd index 9881111d..fe9e2136 100644 --- a/doc/pddp/all_about_lists_vs_anythings.pd +++ b/doc/pddp/all_about_lists_vs_anythings.pd @@ -1,89 +1,122 @@ -#N canvas 197 93 874 603 10; -#X msg 74 278 1 2 3; -#X obj 134 309 route list; -#X msg 41 258 list 1 2 3; +#N canvas 330 124 865 611 10; +#X msg 95 288 1 2 3; +#X obj 125 319 route list; +#X msg 62 268 list 1 2 3; #X msg 10 63 list; -#X msg 17 83 list 5; -#X msg 24 103 list pie; #X symbolatom 32 129 10 0 0 0 - - -; #X obj 4 2 cnv 15 850 20 empty empty all_about_lists_vs_anythings 20 10 1 18 -233017 -66577 0; -#X obj 821 3 pddp; -#X text 20 558 by Hans-Christoph Steiner ; -#X obj 65 437 list2int; -#X obj 129 436 l2i; -#X obj 131 462 a2l; -#X obj 64 463 any2list; -#X obj 64 413 lister; -#X obj 64 489 list2symbol; -#X obj 64 510 symbol2list; -#X obj 153 489 l2s; -#X obj 153 509 s2l; -#X obj 197 490 tosymbol; -#X obj 197 509 fromsymbol; -#X text 501 288 use [prepend]!!; -#X obj 618 286 prepend; -#X obj 661 331 drip; -#X text 568 331 write about:; -#X obj 539 411 glue; -#X obj 600 438 pack; -#X obj 599 412 list2symbol; -#X obj 709 411 tosymbol; -#X text 8 208 More than one "float" in a message is considered a "list". +#X text 9 218 More than one "float" in a message is considered a "list". More than one "symbol" in a message is not implicitly considered a "list" \, only if you cast it.; -#X text 87 104 A "list" of one "symbol" is translated into a "symbol". -; -#X text 72 83 A "list" of one "float" is translated into a "float". -; -#X text 50 63 An empty "list" is tranlated into a "bang".; #X text 7 39 SPECIAL CASES OF "LISTS".; -#X text 497 243 working with "lists" and "anythings":; -#X text 516 385 making "lists" from untyped inputs:; -#X obj 10 148 print NOT-LISTS; -#X obj 475 411 repack; -#X obj 134 332 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj 125 342 bng 15 250 50 0 empty empty list -20 7 1 10 -262144 +-1 -1; +#X obj 189 343 bng 15 250 50 0 empty empty non-list 19 7 1 10 -262144 +-1 -1; +#X msg 184 267 list this is a set with a cast; +#X msg 191 286 this is a set withOUT a cast; +#X obj 488 138 bng 15 250 50 0 empty empty bang 0 20 1 9 -262144 -1 +-1; +#X obj 535 138 bng 15 250 50 0 empty empty float 0 21 1 9 -262144 -1 -1; -#X obj 198 333 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj 684 138 bng 15 250 50 0 empty empty symbol 0 21 1 9 -262144 +-1 -1; +#X msg 486 73 list this is a set with a cast; +#X msg 493 92 this is a set withOUT a cast; +#X obj 585 138 bng 15 250 50 0 empty empty list 0 21 1 9 -262144 -1 -1; -#X text 478 138 Miller's list explanation; -#X obj 65 391 list; -#X obj 64 366 any; -#X obj 93 366 pipe; -#X text 509 190 - anything is not a atom type; -#X text 506 162 - lists map to inlets \, non-lists don't; -#X obj 55 166 route b f s; -#X msg 183 257 list this is a set with a cast; -#X msg 190 276 this is a set withOUT a cast; -#X text 370 475 a set that is not a "list" has an undefined type:; -#X obj 469 568 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj 100 528 route list; +#X obj 100 551 bng 15 250 50 0 empty empty list -20 7 1 10 -262144 +-1 -1; +#X obj 164 552 bng 15 250 50 0 empty empty non-list 19 7 1 10 -262144 +-1 -1; +#X msg 20 491 one 2 three 4 five; +#X msg 20 469 1 two 3 four 5; +#X text 8 198 IMPLICIT LISTS; +#X msg 179 469 list 1 two 3 four 5; +#X msg 179 491 list one 2 three 4 five; +#X msg 17 83 list 25; +#X msg 24 103 list foo; +#X obj 10 171 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 516 567 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj 57 170 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 564 566 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj 105 169 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X msg 468 501 list this is a set with a cast; -#X msg 475 520 this is a set withOUT a cast; -#X obj 469 545 route bang float symbol list; -#X obj 612 567 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj 153 170 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 660 566 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj 201 169 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; +#X obj 10 148 route bang float symbol list; +#X text 87 104 A "list" of one "symbol" is converted to a "symbol" +; +#X text 72 83 A "list" of one "float" is converted to a "float"; +#X text 50 63 An empty "list" is converted to a "bang"; +#X obj 520 514 pddp_open all_about_atom_conversion; +#X obj 821 3 pddp; +#X text 11 392 Sets of mixed atoms are defined based on what the "selector" +(the first element of a set). If the "selector" is a "float" \, then +the set is a "list". If the "selector" is the word "list" \, then the +set is a "list". If the "selector" is a "symbol" \, then the set is +NOT a "list":; +#X text 22 575 (C) Copyright 2004 Hans-Christoph Steiner +; +#X text 239 589 released under the GNU GPL; +#X text 445 576 $Revision: 1.4 $$Date: 2005-04-28 00:25:04 $; +#X text 446 589 $Author: eighthave $; +#X text 673 551 updated for Pd 0.38-2; +#X obj 487 117 route bang float list pointer symbol; +#X obj 635 138 bng 15 250 50 0 empty empty pointer 0 21 1 9 -262144 +-1 -1; +#X obj 734 138 bng 15 250 50 0 empty empty UNDEFINED 0 21 1 9 -262144 +-1 -1; +#X msg 502 286 1 1; +#X obj 495 312 +; +#X floatatom 495 334 5 0 0 0 - - -; +#X msg 467 286 1 3; +#X text 459 46 A set that is not a "list" has an undefined type:; +#X msg 494 267 list 1 2; +#X text 445 208 If you send a "list" of arguments to the first inlet +of an object \, the elements of that "list" will be applied to the +respective inlet. This does not apply to sets that are NOT "lists". +; +#X text 443 192 "LISTS" MAP TO INLETS; +#X text 450 389 When working with sets that might be either "lists" +or undefined \, use [prepend]. Most of the "list" handling objects +in Pd are not general enough to handle this situation.; +#X text 450 367 WORKING WITH MIXED SETS; +#X text 11 373 SETS OF MIXED "ATOMS"; #X connect 0 0 1 0; -#X connect 1 0 38 0; -#X connect 1 1 39 0; +#X connect 1 0 8 0; +#X connect 1 1 9 0; #X connect 2 0 1 0; -#X connect 3 0 36 0; -#X connect 4 0 36 0; -#X connect 5 0 6 0; -#X connect 5 0 36 0; -#X connect 27 0 26 0; -#X connect 47 0 1 0; -#X connect 48 0 1 0; -#X connect 53 0 55 0; -#X connect 54 0 55 0; -#X connect 55 0 50 0; -#X connect 55 1 51 0; -#X connect 55 2 52 0; -#X connect 55 3 56 0; -#X connect 55 4 57 0; +#X connect 3 0 33 0; +#X connect 10 0 1 0; +#X connect 11 0 1 0; +#X connect 15 0 45 0; +#X connect 16 0 45 0; +#X connect 18 0 19 0; +#X connect 18 1 20 0; +#X connect 21 0 18 0; +#X connect 22 0 18 0; +#X connect 24 0 18 0; +#X connect 25 0 18 0; +#X connect 26 0 33 0; +#X connect 27 0 4 0; +#X connect 27 0 33 0; +#X connect 33 0 28 0; +#X connect 33 1 29 0; +#X connect 33 2 30 0; +#X connect 33 3 31 0; +#X connect 33 4 32 0; +#X connect 45 0 12 0; +#X connect 45 1 13 0; +#X connect 45 2 17 0; +#X connect 45 3 46 0; +#X connect 45 4 14 0; +#X connect 45 5 47 0; +#X connect 48 0 49 0; +#X connect 49 0 50 0; +#X connect 51 0 49 0; +#X connect 53 0 49 0; -- cgit v1.2.1