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

[REBOL] Re: idioms to reduce logic clutter ?

From: carl::cybercraft::co::nz at: 12-Oct-2002 23:32

Hi Jason, A quickish answer... Three REBOL words you may not know off that may help...
>> ? any
USAGE: ANY block DESCRIPTION: Shortcut OR. Evaluates and returns the first value that is not FALSE or NONE. ANY is a native value. ARGUMENTS: block -- Block of expressions (Type: block)
>> ? all
USAGE: ALL block DESCRIPTION: Shortcut AND. Evaluates and returns at the first FALSE or NONE. ALL is a native value. ARGUMENTS: block -- Block of expressions (Type: block)
>> ? switch
USAGE: SWITCH value cases /default case DESCRIPTION: Selects a choice and evaluates what follows it. SWITCH is a function value. ARGUMENTS: value -- Value to search for. (Type: any) cases -- Block of cases to search. (Type: block) REFINEMENTS: /default case -- Default case if no others are found. (Type: any) (SPECIAL ATTRIBUTES) throw -- Carl Read