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

[REBOL] Re: How to check function arguments ?

From: greggirwin:mindspring at: 8-Jun-2002 13:26

Hi Jason, << It's kind of embarrassing, but I've forgotten the REBOL idioms for something really basic.. How to check for arguments provided to a function? How to check when the argument is optional and when it is missing? somefunc: func [arg1 arg2 ... argN] [ ; check args here and respond ] >> Do you mean refinements? ; arg-2 is an optional arg. flag-it is a refinment with no args. somefunc: func [arg1 /has-arg-2 arg2 /flag-it] [ if has-arg-2 [ print arg-2 ] if flag-it [print "flagged"] ] --Gregg