"any" is pretty cool! That does help!
factorial: func [num][
fact: func [n a][
any [
all [lesser? n 0 print "I don't know"]
all [switch n [0 1 a]]
all [fact subtract n 1 multiply n a]
]
]
fact num 1
]
chaz
At 09:59 AM 11/16/00 -0800, you wrote:
>Hi Rodney
>
>One nice way to do this is:
>
>>> one: false
>== false
>>> two: false
>== false
>>> three: true
>== true
>>>
>>> any [all [one print "1"] all [two print "2"] all [three print "3"]]
>3
>
>Notice that ANY and ALL can return the values of any expression as well as
>just true and false. BTW, the construct above has the same functionality as
>a COND in Scheme or Lisp.
>
>HTH
>-Larry
>
>----- Original Message -----
>From: Rodney Snell <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Thursday, November 16, 2000 9:33 AM
>Subject: [REBOL] Multiple Word Conditional?
>
>
>> 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?
>>
>> Thanks,
>>
>> Rodney
>> --
>> To unsubscribe from this list, please send an email to
>> [EMAIL PROTECTED] with "unsubscribe" in the
>> subject, without the quotes.
>
>--
>To unsubscribe from this list, please send an email to
>[EMAIL PROTECTED] with "unsubscribe" in the
>subject, without the quotes.
>
>
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.