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

[REBOL] while statement problem Re:(4)

From: rebol:techscribe at: 3-Oct-2000 11:17

[joel--neely--fedex--com] wrote:
> The REAL root cause of your error message is that REBOL doesn't use > operator precendence (as other programming languages do). Consecutive > operators are evaluated left-to-right, meaning that your original: > > prime and test <= square-root number > > is evaluated with the same meaning as > > (prime and test) <= square-root number > > which would try to apply and to a boolean and a number (and then would > try to apply <= between a boolean and a number, but we don't get that far). > The first of these generates the show-stopping error, as in:
Correct. BTW, REBOL does accept boolean operations on integers, tuples and issues. (perhaps other datatypes?) But all values must be consistent and share the same datatype. For instance:
>> 1 and 1
== 1
>> 1 and 0
== 0 But
>> 1 and true
** Script Error: Expected one of: integer! - not logic!. ** Where: 1 and true Elan