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

[REBOL] Re: [none idiom found?] The best shortcut word for "not none?"

From: lmecir::mbox::vol::cz at: 5-Sep-2006 6:14

Gregg Irwin napsal(a):
> This is a *really* good question. I'm always amazed at the behavior > we find that you might think would be a problem, but isn't, in > practical use. I don't know that I've ever been bitten by the above, > but it seems like an obvious flaw when you look at it that way. >
If the CASES block you supply to SWITCH has got the expected format, then you cannot have a problem. The fact is, that SWITCH does not check whether the CASES block has got the expected format, though. Another problem may occur if you supply a function instead of an "expected" block.
> Maybe this would be a good question for a blog post by Carl. I > remember him saying once that FORALL and FORSKOP were originally > intended as macros for WHILE, hence leaving the series at the tail. I > wonder if the original goal for FOUND? considered its use with ANY and > ALL, logic results, or just the result of FIND; and does SWITCH work > that way by design, or was it just a convenient implementation with > very little risk (i.e. expected behavior) in everyday use. > > -- Gregg >
I bet that it is the case you described - a convenient implementation not checking whether "the contract" holds, but am asking Carl anyway. -L