Here is a solution by Jonathan Wilkes that fetches the complete list of
creation args including zeros.

Source: https://lists.puredata.info/pipermail/pd-list/2009-04/069941.html

On 22.12.18 19:52, Peter P. wrote:
> * hans w. koch <hansw.k...@gmail.com> [2018-12-22 19:28]:
>> i have this vanilla abstraction based on a patch by johannes, which gives 1 
>> for argument present and 0 if absent
>> maybe thats for you?
> 
> Thanks Hans, this looks good and seems to be a similar way than the one
> proposed by Christof.
> 
> best, P
>>
>> best hans
> 
> 
> 
> _______________________________________________
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> https://lists.puredata.info/listinfo/pd-list
> 
#N canvas 412 3 413 170 12;
#X obj 14 7 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#N canvas 0 0 562 568 arguments 1;
#X obj 39 112 f;
#X obj 39 137 + 1;
#X obj 39 162 t b a;
#X obj 39 462 t a;
#X obj 39 57 until;
#X obj 39 438 list prepend;
#X obj 10 527 outlet;
#X obj 39 7 inlet;
#X obj 39 32 t b b;
#X obj 39 363 list split 1;
#N canvas 368 169 216 100 \$0-test 0;
#X restore 39 308 pd \$0-test;
#X obj 76 253 s pd-\$0-test;
#X obj 39 338 r \$0-arg;
#X obj 76 187 list append \$0 $;
#X msg 122 338 symbol \$3\$1-t;
#X obj 85 388 sel s;
#X obj 85 413 s \$0-argv-end;
#X obj 88 32 s \$0-argv-reset;
#X obj 144 438 r \$0-argv-reset;
#X obj 89 57 r \$0-argv-end;
#X obj 39 278 s \$0-argv-b;
#X msg 76 212 clear \, obj 5 5 r \$2-argv-b \, obj 5 35 list append
\$3\$1 \$3\$1-t \, obj 5 65 s \$2-arg \, connect 0 0 1 0 \, connect
1 0 2 0;
#X obj 89 82 0;
#X obj 10 502 list;
#X connect 0 0 1 0;
#X connect 1 0 0 1;
#X connect 1 0 2 0;
#X connect 2 0 20 0;
#X connect 2 1 13 0;
#X connect 3 0 5 1;
#X connect 3 0 23 1;
#X connect 4 0 0 0;
#X connect 5 0 3 0;
#X connect 7 0 8 0;
#X connect 8 0 4 0;
#X connect 8 1 17 0;
#X connect 9 0 5 0;
#X connect 9 1 15 0;
#X connect 12 0 9 0;
#X connect 13 0 21 0;
#X connect 13 0 14 0;
#X connect 14 0 15 1;
#X connect 15 0 16 0;
#X connect 15 0 23 0;
#X connect 18 0 5 1;
#X connect 18 0 23 1;
#X connect 19 0 4 1;
#X connect 19 0 22 0;
#X connect 21 0 11 0;
#X connect 22 0 0 1;
#X connect 23 0 6 0;
#X restore 14 32 pd arguments;
#X obj 48 61 list length;
#X floatatom 48 86 5 0 0 0 - - -;
#X text 119 31 <-- paste this subpatch into;
#X text 32 4 bang for list of arguments;
#X text 151 46 your abstraction;
#X obj 14 109 print creation_arguments;
#X text 14 138 * outputs a bang if no arguments are given;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 0 7 0;
#X connect 2 0 3 0;
#N canvas 478 416 320 90 12;
#X text 132 29 the subpatch;
#X text 12 10 A test patch-- click inside for;
#X obj 12 58 my_abstraction one 2 three 40 512;

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

Reply via email to