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

[REBOL] Re: Refinements

From: greggirwin:mindspring at: 12-Nov-2002 12:02

Hi Robert, RMM> Hi, I have a bunch of functions that have the same two refinements: RMM> /left /right RMM> How can I propagate refinements from a function when calling an other RMM> function? There is no easy, native, way that I know of. Ladislav has a REFINED function in his highfun.r script, if that will work for you. Sometimes I've added a refinment which allows me to specify a block of custom options (i.e. refinements) for easy propagation. Here's the basic idea: my-func: func [/with options [any-block!] /local ?opt] [ either with [ attempt [ ;<< ATTEMPT requires beta release or patch if find options 'a [print "option A specified"] if options/b [ print ["option B specified. Value =" options/b] ] ] ][ print "no options" ] ] my-func my-func/with [a] my-func/with [b 2] my-func/with [a b 2] Not nearly as clean as native refinements, but much easier to propagate. -- Gregg