lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Andrew Lentvorski <bsder@allcaps.org> wrote:
> > I guess it's because I think in terms of ranges.  Things like micrometers
> > and calipers were always natural to me while other people had a horrible
> > time with them.  Shrug.
> 
Even micrometers and calipers, if you are measuring 10 units,
mark the place where you stop with "10", not with "9".

Tony Finch wrote:
> I agree with you and Dijkstra :-)
> 

I think of ranges in terms of first element, last element.  First 
element is not always at the index origin.  The moment you need
to specify it explitly it is no longer important whether it is 0
or 1 or whatever.

But that particular quote shows Dijkstra shooting himself in the foot.
He starts off: “To denote the subsequence of natural numbers 2, 3, ..., 
12 without the pernicious three dots, four conventions are open to us”, 
these being the four ways of combining one of < or <= with another.  
In Pascal one can write 2..12 — but dots are pernicious, and besides
the notation was invented by Wirth!!  So Dijkstra does not even consider
it!

Dirk