IOhannes m zmoelnig wrote:
i haven't had a look at the tutorial files, but i was wondering why you couldn't build [nrepeat] (i haen't seen [nnrepeat] on the website, so i don't know what it does) with [repeat] or with the [s]/[r] idiom claude has proposed.
see attached patch for a solution using zexy's [repeat].
Yes, that is what I tried too. But it doesn't work -- it fails with re-entrancy bugs when recursion is used.
See attached test patch.
With max-depth 3, repetitions 2:
My [nrepeat] external outputs: nrepeat: 3 0 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 2 1 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 3 1 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 2 1 nrepeat: 1 0 nrepeat: 1 1
Your [nrepeat-abs] abstraction outputs: nrepeat: 3 0 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 2 2 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 3 2 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 2 2 nrepeat: 1 0 nrepeat: 1 1
With max-depth 3, repetitions 3:
My [nrepeat] external outputs: nrepeat: 3 0 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 1 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 2 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 3 1 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 1 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 2 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 3 2 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 1 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 2 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2
Your [nrepeat-abs] abstraction outputs: nrepeat: 3 0 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 3 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 3 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 3 3 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 3 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 3 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 3 3 nrepeat: 2 0 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 3 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2 nrepeat: 2 3 nrepeat: 1 0 nrepeat: 1 1 nrepeat: 1 2
mfgasdr IOhannes
Thanks,
Claude
#N canvas 0 0 481 517 10; #X obj 71 95 r $0-recurse; #X obj 71 380 s $0-recurse; #X obj 108 260 t b a b; #X obj 192 280 v $0-depth; #X obj 192 300 - 1; #X obj 192 320 max 0; #X obj 130 340 spigot; #X obj 192 340 v $0-depth; #X obj 166 160 t b f; #X obj 166 183 v $0-depth; #X obj 166 208 pack f f; #X obj 165 239 print nrepeat; #X obj 108 280 v $0-depth; #X obj 108 320 v $0-depth; #X obj 108 300 + 1; #X obj 108 50 t a b; #X msg 108 21 nrepeat test; #X obj 285 108 v $0-depth; #X floatatom 262 77 5 0 0 2 max-depth - -; #X floatatom 261 38 5 0 0 2 repetitions - -; #X obj 246 108 f 3; #X obj 108 135 nrepeat 2; #X connect 0 0 21 0; #X connect 2 0 12 0; #X connect 2 1 6 0; #X connect 2 2 3 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 6 1; #X connect 5 0 7 0; #X connect 6 0 1 0; #X connect 8 0 9 0; #X connect 8 1 10 1; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 12 0 14 0; #X connect 14 0 13 0; #X connect 15 0 21 0; #X connect 15 1 20 0; #X connect 16 0 15 0; #X connect 18 0 20 1; #X connect 19 0 21 1; #X connect 20 0 17 0; #X connect 21 0 2 0; #X connect 21 1 8 0;