Hi, Rodney,

I believe it was Gabriele...  (Credit where credit is due, and
all that...)

[EMAIL PROTECTED] wrote:
> 
> Given three mutually exclusive refinements in a function
> (or just three words in a script), what is the best way
> to perform the conditional?
> 
> one: false
> two: false
> three: true
> 
> Of course we can do:
> 
> either one [print "1"] [either two [print "2"][print "3"]]
> 
> but this gets ugly for more than three words and I thought
> that someone recently posted a trick using 'any
> that made this simpler and more readable.  Can't find it
> though.  Any suggestions?
> 

    >> one: two: not three: true    == false

    any [
        if one [print "1"]
        if two [print "2"]
        if three [print "3"]
    ]

    3
    >>

-jn-

-- 
; Joel Neely  [EMAIL PROTECTED]  901-263-4460  38017/HKA/9677
REBOL []  foreach [order string]  sort/skip reduce [ true "!"
false  head reverse "rekcah"  none "REBOL "  prin "Just " "another "
] 2 [prin string] print ""
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to