[PD] new vanilla list-abs: list-slice, list-value and more

Luke Iannini lukexipd at gmail.com
Tue Sep 23 11:22:40 CEST 2008

I continue to collect list-abs (among other things) in SVN under
abstractions/senderfruit/, but I thought I'd highlight a few recent
ones that I have found particularly handy as of late:

list-slice - the latest addition: works just like Python's slice
notation, and thanks to list-splat, even accepts negative indices.
[list-slice 2 -2] gives the list minus its first two and last two
elements.  [list-slice 5 0] gives the 5th element (which is always
Lelu) through the end of the list, or [list-slice 0 4] for the first 4
elements (rapping, scratching, graffiti and breakin').

list-value and its brother list-value-extend: [value] for lists.  All
same-named [list-value] objects always hold the same list, even newly
created ones.
list-value-extend is a handy shortcut that appends new values rather
than replacing.  Both accept [clear( to clear their contents.

list-dripx is just like list-drip, except it drips "x" values at a
time (e.g. [a b c d e f g h i( becomes [a b c( [d e f( [g h i(  )

list-proc-insert does decorating: cross connect it with a process to
process incoming lists and then insert the results back into the
original list.  For example, append the length of a list onto the
original list (oh no, now it is creating paradoxes).  It has uses, I
promise, I just can't remember them right now.

Finally, list-split-at, which simply splits a list every time it
encounters a delimiter, so [a b * c d e * f(-[list-split-at *] gives
[a b( [c d e( [f(.

This time, these are all thankfully French vanilla bean.  (well,
except for [import] statements, feel free to strip them if you don't
need them or make a dummy [import] object)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: new-list-abs.zip
Type: application/zip
Size: 7707 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20080923/98959a0b/attachment.zip>

More information about the Pd-list mailing list