lua-users home
lua-l archive

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


> I think you have to be very careful about making this case.  How
> tolerant of backwards-incompatibility do you thing the Lua user base
> would be if the Lua authors modernized the language to support
> zero-based array and string indexing? 

I believe that one-based indexing was very intentional.
Most people (who haven't had their minds warped into
conflating ordinals with pointer offsets) expect the
third item in a list to be #3.  That's certainly what my
grocery list looks like.  Lua was designed to be usable
by these people.

But even so, zero-based array indexing would be a 
minor change in comparison with, say, throwing out the
preprocessor, replacing tag methods with metatables,
replacing upvalues with lexical scoping, scooping
global functions into packages, overhauling the
C API, etc. etc.  Even the 5.0 -> 5.1 incompatibilities
are beyond what many language communities would
tolerate.  Making changes of that scope to Javascript
would break the world.

Imagine a Lua that was forced into preserving tag 
methods and upvalues and arg and the rest of the 
obsolete cruft for fear of breaking a large installed 
base of programs.  Actually, you don't have to imagine;
it's called "Perl".

-Bret