[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: lists with nil play nice for Lua 5.2
- From: "Jerome Vuarand" <jerome.vuarand@...>
- Date: Thu, 9 Aug 2007 15:45:43 -0400
Tony Finch wrote:
> On Thu, 9 Aug 2007, Paul Ducklin wrote:
>>> Lua's 1-based native indexing
>>> already annoys people
>> Errrr, which people exactly?
> Dijkstra has some good arguments:
In this paper he says that 0-based indexing is better if you use
convention 'a' (loops of the form 'for (i=0; i<N; ++i)'). Lua uses
convention 'c' (loops of the form 'for (i=1; i<=N; ++i)', or in Lua 'for
i=1,N do'), so 1-based indexing is more suited to Lua.