1
#N canvas 13 96 1051 669 10;
3
#X floatatom 682 190 0 0 128 0 - - -;
4
#X msg 58 185 add alias;
5
#X msg 58 203 add bind;
6
#X msg 58 221 add break;
7
#X msg 58 240 add built-in;
8
#X msg 58 259 add case;
9
#X msg 642 417 delete bind;
10
#X msg 642 435 delete break;
11
#X msg 642 454 delete built-in;
12
#X msg 642 473 delete case;
13
#X obj 514 287 symbol;
15
#X msg 533 248 built-in;
19
#X obj 514 305 send 2index;
20
#X obj 61 431 receive 2index;
21
#X obj 630 511 send 2index;
22
#X obj 44 297 send 2index;
23
#X text 522 156 get item index;
24
#X text 516 170 (evt. add new item);
25
#X text 33 154 add new item to map;
26
#X text 640 360 delete item from map;
27
#X text 128 39 creation : "index [<n> [<auto>]]";
28
#X msg 642 399 delete alias;
29
#X text 162 73 auto :: 1_sets auto ON \, 0_sets auto OFF (default off)
31
#X text 705 14 part of zexy;
32
#X floatatom 61 573 0 0 0 0 - - -;
33
#X symbolatom 121 572 0 0 0 0 - - -;
34
#X obj 61 552 route float symbol;
35
#X obj 196 552 print INDEX;
36
#X obj 682 294 send 2index;
37
#X text 673 168 query an item at index #;
38
#X text 61 9 index:: create a symbol->int map;
39
#X text 164 59 n :: initial max. number of elements in list (default:
42
#N canvas 0 0 849 372 administrative 0;
45
#X text 50 58 clear map;
46
#X msg 103 155 auto \$1;
47
#X obj 103 134 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
49
#X obj 156 205 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
51
#X msg 156 226 resize \$1;
52
#X text 174 116 in AUTO mode \, unknown symbols are automatically added
54
#X text 175 143 in NON-AUTO mode (default) \, only ADDed symbols (eg.
55
"add <symbol>") are added to the map;
56
#X text 235 197 normally \, the map will resize automatically if it
57
gets to small. you can prevent it from resizing by sending a "resize
64
#X restore 187 450 pd administrative;
65
#N canvas 0 0 673 455 advanced 0;
70
#X text 124 56 output the number of stored entries;
71
#X text 128 109 dump each entry in the format "list <symbol> <index>"
73
#X msg 114 161 compact;
74
#X text 173 161 compact the entries \, so there are no holes in the
76
#X text 159 253 sort the elements alphabetically;
77
#X text 172 198 this does not produce any immediate output!;
78
#X text 177 179 (e.g. "1 ... foo \, 3 ... bar" --> "1 ... foo \, 2
80
#X text 156 270 (e.g. "1 ... foo \, 2 ... bar" --> "1 ... bar \, 2
82
#X text 161 288 this does not produce any immediate output!;
87
#X restore 190 480 pd advanced;
88
#X text 320 450 open subpatch for administrative messages;
89
#X text 320 480 open subpatch for advanced messages;
90
#X obj 61 507 index 10 1;
91
#X obj 210 299 send 2index;
92
#X text 199 156 add new item to map at index#;
93
#X msg 224 187 add foo 7;
94
#X msg 231 221 add bar 2;
95
#X text 205 168 (if that slot is still free);
96
#X obj 824 514 send 2index;
97
#X text 834 363 delete item at index# from map;
98
#X msg 824 402 delete 6;
99
#X text 88 123 "0" indicates success \; "-1" indicates an error;
100
#X text 45 105 NOTE: indices start counting from "1" !!!;
111
#X connect 10 0 19 0;
112
#X connect 11 0 17 0;
113
#X connect 12 0 11 0;
114
#X connect 13 0 11 0;
115
#X connect 14 0 11 0;
116
#X connect 15 0 11 0;
117
#X connect 16 0 11 0;
118
#X connect 18 0 42 0;
119
#X connect 26 0 19 0;
120
#X connect 31 0 29 0;
121
#X connect 31 1 30 0;
122
#X connect 31 2 32 0;
123
#X connect 38 0 42 0;
124
#X connect 39 0 42 0;
125
#X connect 42 0 31 0;
126
#X connect 45 0 43 0;
127
#X connect 46 0 43 0;
128
#X connect 50 0 48 0;