[PD-dev] recursion in Gem - a tutorial

Claude Heiland-Allen claudiusmaximus at goto10.org
Thu Jul 19 09:58:29 CEST 2007


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

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: nrepeat-test.pd
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20070719/013e8408/attachment.asc>


More information about the Pd-dev mailing list