From: X1 Date: 2007-07-17T13:20:49+09:00 Subject: Re: The Pebble in the Ruby Shoe Agreed. The pebble is a ruby :-) Sent from my iPhone On Jul 17, 2007, at 12:00 AM, Pe単a, Botp wrote: > From: Raphael Gillett [mailto:r.gillett@rational.demon.co.uk] > # Ruby aims to be a human friendly programming language that > ... > # The pebble in the Ruby shoe is the counter-intuitive use of > # indexing of elements of arrays, strings, etc., from 0 to n-1 > # instead of the more natural 1 to n. > > an ones preference evolves, so does his knowledge of numbers: from > counting, to integers, to rationals, reals, abstract, etc.. > > ruby is quite encompassing. array indices are integers: negative, > zero, positive, and the ranges thereof... > > irb(main):001:0> a=[1,2,3] > => [1, 2, 3] > irb(main):002:0> a[0] > => 1 > irb(main):003:0> a[-1] > => 3 > irb(main):004:0> a[1] > => 2 > > irb(main):006:0> a[0..2] > => [1, 2, 3] > irb(main):007:0> a[0..-2] > => [1, 2] > > thus for me, with ruby, the shoe fits, and it fits well. > > kind regards -botp >