Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: The all function.

From: anton:lexicon at: 13-Apr-2002 15:42

No, adding copy didn't fix your code. Removing the 2 did. (Although, I am not really sure it is fixed...) The problem is that find takes two arguments, not three, as you seem to think in this line: find database 2 chknum This just returns the value of chknum. You had obviously set chknum sometime in your testing on the console. I'll put brackets to show how the above line was evaluated: (find database 2) (chknum) The first value returns none, the second value returns 9898 , which must have been what you set it to at some point. In the 'all block, you actually had three values to check, not two, as I am sure you thought you had: rec: all [find database code find database 2 chknum] I will put brackets to show how it was evaluated. rec: all [(find database code) (find database 2) chknum] So 'all would have returned at the second value (none). Perhaps you meant to write: find database/2 chknum That means to look in the second value of the hash! Anton.