[Edu-sig] Re: In defense of 0, was Re: None potato, one potato,
two potato, more..
Trent Oliphant
trent at oliphant.org
Mon Jan 5 12:58:44 EST 2004
>
>>So the indexing notation [n] could be considered shorthand for [n:n+1]? You
>>are taking a slice of len 1 starting at n?
>>
>>
>
>
> I would say it's the object that lays n cm from the beginning, but
> since each item is 1cm wide the effect is the same. The first object
> is, of course, 0cm from the beginning.
>
I know this is nit picking, and you yourself said you only use it
explain to your scouts. I would argue that the use of the model without
the explaination of it being a form of shorthand would be contradictory
with the fact that it takes a beginning and an ending to describe
anything of any width. The effect is indeed the same, but I think it
makes other things much easier to understand if you complete the model.
Since you describe that each item has a width. I think it makes
slices easier to understand the notation.
I do like the model, because I have now been able to resolve the
inconsitencies with the negative notation.
For example:
If I look at [-2] as shorthand for [-2:-1], it is no longer based on 0
or 1 based indexing, but the item that starts at position 2 from the end
of length one. ([-1] would be shorthand for [-1:])
Trent
More information about the Edu-sig
mailing list