Hallo, 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)
Cheers Luke
Hi, you might be interested by [list-build 5] that will output a list every five items, it's attached
Le mardi 23 septembre 2008 à 02:22 -0700, Luke Iannini a écrit :
Hallo, 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)
Cheers Luke _______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hallo,
these are cool, I will definitely include some of them (minus the import, which then isn't needed anymore).
I'm just wondering, if I should just add the second inlet to [list-drip] directly instead of using an extra object [list-dripx]. What do people think?
Luke Iannini hat gesagt: // Luke Iannini wrote:
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.
One use is to build something like [list-enumerate].
However maybe this one is a bit too simple to make it into a separate abstraction for [list]-abs? It's more or less just:
...
|
[t a a]
|
[ ? ]
|
[list-insert]
|
...
Or am I oversimplifying? ;)
Frank Barknecht _ ______footils.org__
Frank Barknecht wrote:
I'm just wondering, if I should just add the second inlet to [list-drip] directly instead of using an extra object [list-dripx]. What do people think?
this makes it more compatible to zexy's [repack] so i vote for the 2nd inlet (+argument) (unfortunately [repack] defaults to [repack 2]...)
fgmasdr IOhannes
if someone is interrested to include this list-abs ?
It is called [list-order] because it order a list with numbers (asc
or desc).
++
Jack
Le 23 sept. 08 à 11:22, Luke Iannini a écrit :
Hallo, 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)
Cheers Luke<new-list-abs.zip>_______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
On 25/09/2008, at 18.46, Jack wrote:
if someone is interrested to include this list-abs
I also posted a list-abs'ish list abs a while back. Maybe we can make
a prospect wiki page that can function as a hub for list-abs that are
not in the list-abs?
@Frank: Would you mind pointing out what (minimum) requirements you
have for accepting new list-abs? Except for it to be vanilla and not
using [prefix/someobj], that i'm guessing is a rule.
Hallo, Steffen Juul hat gesagt: // Steffen Juul wrote:
@Frank: Would you mind pointing out what (minimum) requirements you
have for accepting new list-abs? Except for it to be vanilla and not
using [prefix/someobj], that i'm guessing is a rule.
The minimal requirements for an abstraction in [list]-abs would be: no externals, a well written help file, Pd's BSDish license, and it has to do something with lists.
I would also like to keep the [list]-abs as simple/elegant as possible. (That's actually the only reason list-order or list-sort aren't in yet: The implementations I've seen are rather complex, but I don't know of a simpler way myself. Probably [list sort] should become a builtin function of [list].)
OTOH they shouldn't be too simple: I must admit that in the first wave of creating the abstractions I didn't resist writing and including some trivial ones myself (I probably wouldn't include list-emath etc. again, as [list-map] etc. are better), but now they are in and may be in use somewhere. :(
Frank Barknecht _ ______footils.org__