[PD] heads or tails?

Andrew W. Schmeder andy at e-molecule.com
Fri Aug 16 06:01:29 CEST 2002

<quote who="Adam T. Lindsay">
> I was wondering if there's a regular way of extracting the head and the tail
> (meaning everything but the first element... think car/cdr) of an arbitrary
> list message. I'm rooting through the docs, and am not able to come up with
> an elegant way of doing this. (looked through the past two months of
> archives, and didn't find much)

Use [niagara 1] of zexy.  Send the list into the first inlet.  The first
element will come out of the first outlet and the rest of the list out the
second.  [niagara 2] would break the list in half at the second element.  If
you route the second outlet of [niagara n] into its own first inlet it will
break a long list into many lists of length n.  Very useful!


Andrew W. Schmeder
andy at e-molecule.com

More information about the Pd-list mailing list