aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLuke Iannini <lukeiannini@users.sourceforge.net>2008-09-23 09:20:51 +0000
committerLuke Iannini <lukeiannini@users.sourceforge.net>2008-09-23 09:20:51 +0000
commit89f0eec121e7ed1a5367889a7036bac40c99b135 (patch)
tree00be65a92abed496cfd6e0bbb6d027f43d3fa885 /core
parent0359c9a8c153daa95d00c187b131c41786f92e4c (diff)
more list-abs
svn path=/trunk/abstractions/senderfruit/; revision=10307
Diffstat (limited to 'core')
-rw-r--r--core/list-idx-list-help.pd38
-rw-r--r--core/list-idx-list.pd2
-rw-r--r--core/list-proc-insert-help.pd4
-rw-r--r--core/list-slice-help.pd24
-rw-r--r--core/list-slice.pd56
-rw-r--r--core/list-split-at-help.pd3
6 files changed, 127 insertions, 0 deletions
diff --git a/core/list-idx-list-help.pd b/core/list-idx-list-help.pd
new file mode 100644
index 0000000..79a6b8e
--- /dev/null
+++ b/core/list-idx-list-help.pd
@@ -0,0 +1,38 @@
+#N canvas 0 22 630 440 10;
+#X declare -lib list-abs -lib iemlib;
+#X obj 33 221 list-idx-list in the town where I was born lived a man
+who sailed to sea;
+#X obj 33 98 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
+;
+#X obj 33 78 loadbang;
+#X obj 33 145 f;
+#X obj 60 145 + 1;
+#X obj 86 145 mod 14;
+#X msg 242 140 and he told us of his life in the land of sub ma rines
+;
+#X obj 33 260 list prepend label;
+#X obj 33 283 list trim;
+#X obj 33 307 s \$0.canvas;
+#X obj 37 340 cnv 15 200 60 empty \$0.canvas sailed 70 28 0 20 -257985
+-66577 0;
+#X msg 242 119 in the town where I was born lived a man who sailed
+to sea;
+#X text 26 14 [list-idx-list] a wrapper for list-idx that makes building
+simple "arrays" easier;
+#X text 481 404 2008 Luke Iannini;
+#X obj 33 116 metro 500;
+#X obj 33 176 nbx 2 25 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 20
+-262144 -1 -1 11 256;
+#X connect 0 0 7 0;
+#X connect 1 0 14 0;
+#X connect 2 0 1 0;
+#X connect 3 0 4 0;
+#X connect 3 0 15 0;
+#X connect 4 0 5 0;
+#X connect 5 0 3 1;
+#X connect 6 0 0 1;
+#X connect 7 0 8 0;
+#X connect 8 0 9 0;
+#X connect 11 0 0 1;
+#X connect 14 0 3 0;
+#X connect 15 0 0 0;
diff --git a/core/list-idx-list.pd b/core/list-idx-list.pd
index 9516905..d390395 100644
--- a/core/list-idx-list.pd
+++ b/core/list-idx-list.pd
@@ -8,6 +8,7 @@
#X obj 39 44 t b a;
#X obj 39 156 outlet;
#X obj 135 68 import list-abs iemlib;
+#X obj 140 23 inlet;
#X connect 0 0 6 0;
#X connect 1 0 2 1;
#X connect 2 0 0 0;
@@ -15,3 +16,4 @@
#X connect 4 0 5 0;
#X connect 5 0 2 0;
#X connect 5 1 0 1;
+#X connect 8 0 2 1;
diff --git a/core/list-proc-insert-help.pd b/core/list-proc-insert-help.pd
index 28e0d33..07d112f 100644
--- a/core/list-proc-insert-help.pd
+++ b/core/list-proc-insert-help.pd
@@ -1,4 +1,7 @@
#N canvas 246 385 587 311 10;
+#X declare -lib list-abs;
+#X declare -lib list-abs;
+#X declare -lib list-abs;
#X obj 58 181 list-proc-insert;
#X msg 58 96 a b c d e f g;
#X obj 182 181 list-len;
@@ -35,6 +38,7 @@ to the original list.;
#X restore 310 185 pd how_to_append;
#X text 7 6 list-proc-insert: call user-defined process on incoming
list and insert result into original list at position POS.;
+#X obj 416 30 import list-abs;
#X connect 0 0 5 0;
#X connect 0 1 2 0;
#X connect 1 0 0 0;
diff --git a/core/list-slice-help.pd b/core/list-slice-help.pd
new file mode 100644
index 0000000..af07c8b
--- /dev/null
+++ b/core/list-slice-help.pd
@@ -0,0 +1,24 @@
+#N canvas 620 339 431 350 10;
+#X declare -lib list-abs;
+#X obj 107 307 print;
+#X msg 107 154 0 1 2 3 4 5 6 7 8 9 10 11;
+#X text 6 12 [list-slice]: grab a slice from the interior of a list.
+First arg is the start-index (inclusive) \, second arg is the end index
+(not inclusive).;
+#X text 5 59 Added coolness: negative indices work for both arguments.
+;
+#X text 12 73 e.g.: 2 -2 removes the first two and last two items;
+#X obj 107 262 list-slice 3 8;
+#X msg 148 186 2 -2;
+#X msg 158 211 -5 -2;
+#X obj 148 240 unpack f f;
+#X text 257 309 2008 Luke Iannini;
+#X text 257 325 proyekto.net sndrft;
+#X text 43 88 -5 -2 gives the fifth-to-last through third-to-last items
+;
+#X connect 1 0 5 0;
+#X connect 5 0 0 0;
+#X connect 6 0 8 0;
+#X connect 7 0 8 0;
+#X connect 8 0 5 1;
+#X connect 8 1 5 2;
diff --git a/core/list-slice.pd b/core/list-slice.pd
new file mode 100644
index 0000000..255bbd3
--- /dev/null
+++ b/core/list-slice.pd
@@ -0,0 +1,56 @@
+#N canvas 73 356 492 370 10;
+#X declare -lib list-abs;
+#X obj 308 24 import list-abs;
+#X obj 57 14 inlet;
+#X obj 85 318 outlet;
+#X obj 114 15 inlet start-at-idx;
+#X obj 102 237 spigot;
+#X obj 201 87 inlet end-at-idx;
+#X obj 187 237 spigot;
+#X obj 114 79 t a a;
+#X obj 57 99 list-splat;
+#X obj 85 290 list-splat;
+#X obj 122 56 list append \$1;
+#X obj 122 36 loadbang;
+#X obj 187 214 f;
+#X obj 102 262 list-len;
+#X obj 187 261 expr $f2 - $f1;
+#X obj 209 108 loadbang;
+#X obj 209 128 list append \$2;
+#X obj 135 214 == 0;
+#X obj 220 214 > 0;
+#X obj 297 261 spigot;
+#X obj 330 214 < 0;
+#X obj 85 167 t a a b b;
+#X obj 297 213 f;
+#X obj 201 149 t a a a a a;
+#X connect 1 0 8 0;
+#X connect 3 0 7 0;
+#X connect 4 0 13 0;
+#X connect 5 0 23 0;
+#X connect 6 0 14 0;
+#X connect 7 0 8 1;
+#X connect 7 1 12 1;
+#X connect 8 1 21 0;
+#X connect 9 0 2 0;
+#X connect 10 0 7 0;
+#X connect 11 0 10 0;
+#X connect 12 0 6 0;
+#X connect 13 0 9 1;
+#X connect 14 0 9 1;
+#X connect 15 0 16 0;
+#X connect 16 0 23 0;
+#X connect 17 0 4 1;
+#X connect 18 0 6 1;
+#X connect 19 0 9 1;
+#X connect 20 0 19 1;
+#X connect 21 0 9 0;
+#X connect 21 1 4 0;
+#X connect 21 2 12 0;
+#X connect 21 3 22 0;
+#X connect 22 0 19 0;
+#X connect 23 0 17 0;
+#X connect 23 1 18 0;
+#X connect 23 2 14 1;
+#X connect 23 3 22 1;
+#X connect 23 4 20 0;
diff --git a/core/list-split-at-help.pd b/core/list-split-at-help.pd
index ad3c485..a6c29f8 100644
--- a/core/list-split-at-help.pd
+++ b/core/list-split-at-help.pd
@@ -1,4 +1,6 @@
#N canvas 741 82 388 382 10;
+#X declare -lib list-abs;
+#X declare -lib list-abs;
#X obj 49 128 list-split-at /;
#X msg 161 128 symbol |;
#X msg 161 158 symbol /;
@@ -22,6 +24,7 @@ encountering a delimiter;
#X msg 49 227;
#X text 271 289 2008 Luke Iannini;
#X text 271 303 proyekto.net;
+#X obj 256 36 import list-abs;
#X connect 0 0 3 0;
#X connect 0 1 6 0;
#X connect 1 0 0 1;