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

[REBOL] Correct Behaviour? Was False = 2 ?????

From: robbo1mark:aol at: 2-Jul-2001 6:25

JOEL NEELY, Hi Joel, are you saying that you think this should be the "CORRECT" or "CONSISTENT" REBOL Behaviour. Notice I've given 'PICK the ability to accept an integer! logic! & none! value for indexing values, is this correct / consistent in your opinion?
>> to-integer false
== 0
>> to-integer true
== 1
>> to-integer none
== 0
>> to-logic 0
== false
>> to-logic 1
== true
>> to-logic none
== false
>> alpha: [a b c d e f g]
== [a b c d e f g]
>> index? alpha
== 0
>> length? alpha
== 7
>> pick alpha 0
== a
>> pick alpha 1
== b
>> first alpha
== a
>> second alpha
== b
>> last alpha
== g
>> pick alpha true
== b
>> pick alpha false
== a
>> pick alpha none
== a
>> logic: [false true]
== [true false]
>> pick logic 0
== false
>> pick logic 1
== true
>> pick logic true
== true
>> pick logic false
== false
>> pick logic none
== false
>> first logic
== false
>> second logic
== true
>> last logic
== true
>> index? logic
== 0
>> length? logic
== 2
>> find alpha 'z
== none
>> find alpha 'c
== [c d e f g]
>> index? find alpha 'c
== 2 Should REBOL display & act with "correctness" and consistency or should it mimic the abiguity and inconsistency that both Larry & yourself imply / state with your previous posts on this thread? I look forward to your comments with much interest. cheers, Mark Dickson