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

[REBOL] Re: Pre-REP on NONE! and SERIES! polymorphism

From: greggirwin:mindspring at: 10-Jun-2002 10:43

Hi Joel, I've been a big fan of Design by Contract for a while, which leads you to be very specific and assert everything that's important to ensure reliable operation. With REBOL, I do things very differently and am still looking at how that mindset fits with my (evolving) REBOL development style. Without further digression, I'd vote for 3c. 3c) ...asking for FIND SELECT and FOREACH to be extended to accept NONE as a first argument. If returning NONE were always considered to be an error condition, that would be a different story, but it isn't. From a DbC viewpoint, I could argue that there is a clear distinction and that you shouldn't be trying to FIND anything in a none! value but, as you pointed out, returning NONE is a standard REBOL idiom. If you want to check for NONE values in certain cases, there is nothing to prevent you from doing that, but that would be the exception. Most code would benefit I think. --Gregg