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

[REBOL] Re: Millennium + 1 ...

From: rebol:techscribe at: 4-Jan-2001 14:27

Hi Gabriele, however, the way it is implemented is more consistent for a different reason.
>> a: [1 2 3 4] ;- (1) >> pick a 0
== none
>> insert a [-4 -3 -2 -1] >> a: skip a 4 >> a
== [1 2 3 4]
>> pick a 0 ;- (2)
== none (1) and (2) should be equivalent and they currently are. If you were to introduce 0 as the position that precedes the current position of the block, then (1) and (2) would not be equivalent and that would be confusing. Using whole numbers instead of natural numbers for indexing a block would be less user-friendly, because for the second element to be located at index 1 (etc.) is counter-intuitive. Looks to me like the current solution is the best compromise. At the cost of getting a none value at location 0, you avoid zero-indexed blocks (not user friendly), and you avoid inconsistent behavior that depends on whether or not the current block's position happens to be the head of the block. Gabriele Santilli wrote: