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

[REBOL] Re: continue word

From: maximo:meteorstudios at: 17-Oct-2003 17:31

> -----Original Message----- > From: Elan [mailto:[rebol--techscribe--com]] > > The example you bring:
> could just as well (better? ;-) ) be written as > > foreach number [ 8 0 2 4 0 5][ [ if number > 0 [ print 100 / > number ] ]
I was just keeping the example simple ;-)
> I wonder if the combination of if, either and any, all enables us to > cover any and all relevant cases?
they usually do... but nests get deep and it sometimes gets messy to edit... its like if the return word did not exist... sometimes its easier just to return a function when we know the rest is pointless... you can often just chain tests one after another... in the end, this is slower, but I rarely am able to notice the difference between .1 and .2 seconds ;-) I just used a temporary variable instead, like: ;------------------------ success: true if whatever [ success: false ] if unless something else [ success: false ] if success [ do what I need ] ;--------------------------- I tried using any and all and in certain situations but in my problem, it became overly complex to maintain, so basically, I guess its a case by case decision on the method... having a continue word would allow me to skip the rest of the code whenever I find something I know is bad, without having to try and build it up in a fancy mutliple level if/either/any/all block. -Maxim