lua-users home
lua-l archive

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


>> 1.5.1 Why do Lua arrays count from one not zero?
>> The answer does not answer the question. Why?
>
> That's a good point. In my experience engineers and scientists (who
> have been infected with the Excel virus and hack with VBA) don't get
> arrays starting at zero. And they can't read curly-brace languages
> either.

Thats still doesn't answer the question. It defends why its a good
idea to count from 1. But an actual answer is purely historical. Maybe
you want to change question, so an answer that justifies Arrays-from-1
fits? (I personally don't care so much, as mentally somewhat flexible
person you can adept).

>
>> 1.26 Why is there no continue statement?
>>
>> I think that answer could use some coding examples with 5.2 goto.
>
> I took out the old answer (because it breaks repeat..until) but
> Roberto has explained that this is just a side-effect of a wider
> question; which is: what other control structures are possible?

Yes, but isn't a FAQ about questions that are frequently asked
compared to questions that we think should be asked instead? People
are asking for continue and other control structures like redo etc.

> All good ones. Dauminator has suggested socket.sleep(), which takes a
> floating-point second ,for the last item. luaposix definitely needs a
> mention.   #line would be somewhat speculative and might constitute
> 'original research' ;)

We're not Wikipedia :-)

> I mentioned index/newindex in the 'gotchas' page (which needs a link
> BTW) but it's sufficiently a sore point (as Mark pointed out) to
> deserve some write-up.

Keep up the good work on the uFAQ! Its appreciated.