#93 [until -debug n]

open
nobody
None
5
2010-01-30
2010-01-30
No

This would loop like a normal [until] that has received a bang to its left inlet, but at the nth iteration (defined by the user) it stops and outputs a message to the console that says it's reached the nth iteration and might be an infinite loop. As far as I can tell you can't implement a similar safety patch around [until] without interrupting the main object chain. This would be better than inserting a [1000( above the [until] object because:
a) you get feedback to the console when it reaches the last iteration
b) when you're done debugging, you don't have to mess with the wires in the main object chain-- you can just remove the "-debug n" part of [until].

It's also better than making a counter because again, you're not fooling with wires in the main object chain.

Discussion

  • Roman Haefeli

    Roman Haefeli - 2010-01-30

    This could be implemented as an abstraction. There is no need to change the code of until. Check attached [until.dbg <max_iter>] abstraction. When you're done with patch development, just remove the .dbg part of the object name.

    #N canvas 540 357 461 307 10;
    #X obj 22 29 inlet;
    #X obj 22 225 outlet;
    #X obj 22 186 until;
    #X obj 22 54 route float bang;
    #X obj 99 101 \$1;
    #X obj 212 39 inlet;
    #X obj 76 76 t b b b;
    #X msg 132 102 1;
    #X obj 212 62 t b b;
    #X msg 244 88 0;
    #X obj 143 182 f;
    #X obj 143 204 sel 1;
    #X obj 143 226 \$1;
    #X obj 143 270 print error;
    #X msg 143 248 until: loop assumed (after \$1 iterations);
    #X connect 0 0 3 0;
    #X connect 2 0 1 0;
    #X connect 3 0 2 0;
    #X connect 3 1 6 0;
    #X connect 4 0 2 0;
    #X connect 5 0 8 0;
    #X connect 6 0 10 0;
    #X connect 6 1 4 0;
    #X connect 6 2 7 0;
    #X connect 7 0 10 1;
    #X connect 8 0 2 1;
    #X connect 8 1 9 0;
    #X connect 9 0 10 1;
    #X connect 10 0 11 0;
    #X connect 11 0 12 0;
    #X connect 12 0 14 0;
    #X connect 14 0 13 0;

    BTW: is there a way to attach files also by only commenting tracker iterms, or only when opening them?

     
  • Jonathan Wilkes

    Jonathan Wilkes - 2010-01-31

    Thanks, I didn't think about just using an abstraction. That solves it.

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks