From 89f0eec121e7ed1a5367889a7036bac40c99b135 Mon Sep 17 00:00:00 2001 From: Luke Iannini Date: Tue, 23 Sep 2008 09:20:51 +0000 Subject: more list-abs svn path=/trunk/abstractions/senderfruit/; revision=10307 --- core/list-slice-help.pd | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 core/list-slice-help.pd (limited to 'core/list-slice-help.pd') 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; -- cgit v1.2.1