logoalt Hacker News

fullstop • today at 2:34 PM • 0 replies • view on HN

I was unable to find a source, but I seem to recall a group handing out Lua rulers at a conference, and the first mark on the ruler was labeled 1cm.

The other bit was "Why do Lua indexes start at one? The FIRST reason is..."

The 1-based indexing, in my usage, has never been a problem. A lot of people run into this, and I feel that it is because they are trying to make something using only Lua. In fact, I would suggest that if you're trying to use Lua with a shebang that you might not like the language very much.

Where it truly shines is when it is embedded into another runtime. Find something that you already have and extend it so that functionality can be added through Lua scripts. You might even be surprised at how little you actually use indexing.