[REBOL] Re: Propagating refinements
From: greggirwin:mindspring at: 22-Dec-2001 12:52
Hi Sunanda,
<< I think I'll stick to passing parameters as strings if they have to go
anywhere other than the function invoked >>
Hmmm. What about a block of optional refinements? Then you can just pass
that entire block, rather than individual parameters. Sadly, the syntax
isn't nearly as nice as using regular refinements, but it could be a very
flexible approach for special cases.
fn-test: func [
opt [series!] {options are: /ref1, /ref2 arg}
/local arg
][
if find opt /ref1 [print "ref1"]
if arg: select opt /ref2 [print ["ref2" arg]]
]
fn-test []
fn-test [/ref1]
fn-test [/ref2 1]
fn-test [/ref1 /ref2 1]
Just a thought.
--Gregg