[PD] create list by header message

IOhannes m zmölnig zmoelnig at iem.at
Fri Jan 24 10:46:42 CET 2014


On 01/23/2014 07:43 PM, Peter P. wrote:
> Hi,
> 
> this might be totally simple, but I am wondering what is the most
> elegant way of creating a list out of individual messages
> 
> 12
> 23
> 34
> 45
> 
> meaning a list which holds four items, and which is always created at
> the number '12', and sent out at the nu,ner '45', yielding:
> 
> list 12 23 34 45
> 
> so some kind of parallelization depending on a header value (12).
> 

i found [list prepend] to be the easiest accumulator to read (though
performance-wise it's less optimal once it comes to **large** lists)

adding the logic to convert your starting and stopping delimiters to
reset/output the list, is left as an exercise for the user.

fgmadrs
IOhannes

-------------- next part --------------
#N canvas 459 190 604 364 10;
#X msg 230 92 12 \, 23 \, 34 \, 45;
#X obj 149 209 list prepend;
#X obj 230 161 list prepend;
#X obj 230 183 t a a;
#X obj 149 231 print;
#X obj 311 136 t b b;
#X msg 57 86 bang;
#X obj 57 108 t b b;
#X text 226 66 data to accumulate;
#X text 44 64 output and reset;
#X connect 0 0 2 0;
#X connect 1 0 4 0;
#X connect 2 0 3 0;
#X connect 3 0 1 1;
#X connect 3 1 2 1;
#X connect 5 0 2 1;
#X connect 5 1 1 1;
#X connect 6 0 7 0;
#X connect 7 0 5 0;
#X connect 7 1 1 0;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 880 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20140124/1bbaacf0/attachment.pgp>


More information about the Pd-list mailing list