Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Help me, Obi Reb Kenobi, you're my only hope!

From: rotenca:telvia:it at: 2-Sep-2002 13:38

Hi Ladislav and all,
>, I was wrong. Here is a (complicated, but working) version of the DEFAULT >function, that can handle it:
I also was experimenting with do/next and this is my code. It try to handle also return, throw, break. isr?: function [blk [block!]][res][ while [not tail? blk][ either error? try [ error? catch [ error? do does [ error? loop 1 [ error? set 'res do/next compose [error? (blk)] ] ] ] ][ return true ][ if none? res [prin "control detected " return false] blk: second res res: none ] ] false ] block2: head insert tail copy [] try [first []] isr? [1 2 first block2 3] ;==false isr? [1 2 first block 3] ;==true isr? [1 2 throw first block2 3] ;==control detected false isr? [1 2 throw first block 3] ;==true isr? [1 2 return first block2 3] ;==control detected false isr? [1 2 return first block 3] ;==true isr? [1 2 break/return first block2 3] ;==control detected false isr? [1 2 break/return first block 3] ;==true --- Ciao Romano