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

[REBOL] Re: Millennium + 1 ...

From: g:santilli:tiscalinet:it at: 5-Jan-2001 19:19

Hello Elan! On 05-Gen-01, you wrote: E> however, the way it is implemented is more consistent for a E> different reason. I'm not sure about this. The current implementation is probably closer to the human way of thinking, but it can introduce subtle problems. I'm not saying this is an important problem, and the way it is worked for me since REBOL was released. E>>> a: [1 2 3 4] ;- (1) E>>> pick a 0 E> == none E>>> insert a [-4 -3 -2 -1] E>>> a: skip a 4 E>>> a E> == [1 2 3 4] E>>> pick a 0 ;- (2) E> == none The two give different results anyway if you use an index lesser than zero:
>> a: [1 2 3 4]
== [1 2 3 4]
>> pick a -1
== none
>> a: insert a [-4 -3 -2 -1]
== [1 2 3 4]
>> pick a -1
== -1 E> (1) and (2) should be equivalent and they currently are. I'd prefer:
>> a: [1 2 3 4]
== [1 2 3 4]
>> pick a 0
== none
>> a: insert a [-3 -2 -1 0]
== [1 2 3 4]
>> pick a 0
== 0 E> you were to introduce 0 as the position that precedes the E> current position of the block, then (1) and (2) would not be E> equivalent and that would be confusing. I don't agree here. You get NONE if the position 0 does not exist. With the current implementation it just never exists... E> Using whole numbers instead of natural numbers for indexing a E> block would be less user-friendly, because for the second E> element to be located at index 1 (etc.) is counter-intuitive. I wouldn't want that to happen. I like the way it is now, but not taking 0 into account COULD introduce problems. It never did for me, tough, and I agree that -1 is a more natural way to get the position before the current one. Regards, Gabriele. -- Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/