[REBOL] Re: Switch with refinements/hmmm!/Most excellent
From: tim::johnsons-web::com at: 31-Oct-2001 15:20
On Wed, Oct 31, 2001 at 02:23:44PM -0800, [sterling--rebol--com] wrote:
> Well, if you only expect one of the refinements to be used...
>
> refine-switch: func[ /ref-one /ref-two /ref-three][
> switch true reduce [ ; needs a value
> ref-one [print "ref-one"]
> ref-two [print "ref-two"]
> ref-three [print "ref-three"]
> ]
> ]
This turns out to be a nice piece of work. I've been struggling
to free myself of "thinking in 'C", and the code example above
has got me close to a moment of edification...
Thanks Sterling.
Now on to Ladislav's pif function.
regards
tim