Hi Paul,

What the example is supposed to illustrate is that even though find returns
none, 

>> find data 432
== none

- after all, you can't expect to find 432 in a block that doesn't contain
432 -

due to the fact 'any ORs its argument block, you will still get some
"valid" result other than none, in this case the 999 which becomes any's
result if find fails and that is what print ends up printing:

>> print any [find data 432 999]
999

i.e. any !in this case! is something like

  either find data 432 [
    ;- we found it, lets return data at 
    ;- index of 432, 
    ;- will never happen in this example
    find data 432
  ][
    ;- if find failes, lets return 999
    999
  ]

except that any accepts any number of arguments in its block.

In contrast all requires that all the expressions in its argument block
evaluate to some none-false value:

>> print all [find data 432 999]
false

Even though 999 did evaluate to a none-false value, find data 432 evaluated
to false and accordinly all's result was false.

Hope this helps clarifying it.

At 09:38 PM 1/27/00 -0600, you wrote:
>   The following user guide doc - expcondition.html - contains a section 
>called Conditional Evaluation where it discusses the use of the any  and
>all   In one of the examples I am  having difficulting understanding the
>example as given:  
>  You can use it with functions like find to  always return a valid
result:   
>>   data: [123 456 789] print any [find data 432 999] 999
>  
>    It may be incorrect but it  seems the find function is not going to
>return any value of  "data:".   I thought maybe this was an error in the 
>documentation.   Paul Tretter Paul's Rebol Page
>http://24.217.20.110/rebolsearch/rebol.htm   
>> 
> 

;- Elan >> [: - )]

Reply via email to