lua-users home
lua-l archive

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


On 11/19/2017 3:22 PM, Paige DePol wrote:
KHMan <keinhong@gmail.com> wrote:

I have no problem with a diversity of views. All you need to do now is to
convince Roberto that he needs the patch... :-)

As for myself, I will take note of whatever the eventual outcome and get
on with coding. My brain is already primed to sound klaxons on seeing
math.huge. Keeping 2s complement arithmetic in looping and its flaw(s)
isn't perfect but it's a known quantity. Patching the looping code would
make it "2s complement but not quite 2s complement". Either way, I hope we
can have some updates to the section on numerical loops in the reference
manual.

I have no problem with diversity of views, I just don't understand your
position on this issue... the math is still all the same, just the logic
about when to add/sub the step value has changed, so your comment about 2s
complement is confusing to me. Also, just because C also would have the same
overflow problem doesn't mean that the issue has to exist in Lua as well,
especially when the fix is a very simple change with negligible impact.

I have used too many microcontroller cross-compilers with all sorts of weird behaviour. Possibly a high tolerance to quirky compilers, like an alcoholic who insists that things are fine... ;-) I am fine with either change or non-change *hic*.

I see in your posting of the final patch that Roberto and others helped with the patch. But Roberto & co have not chimed in here on this topic for some time now. Here we can engage in a long, long, long discussion thread, but it's not really productive to continue discussing this forever without some sort of response to the issue and/or your patch from those who holds the key to Lua's canonical codebase.

When I raised this privately, I got nowhere at all. So I'm happy that there has been a discussion on this. I leave this in the hands of Roberto & co; Lua is their baby, it's their call.

As a scripting language I would expect some error or edge case handling to
be present. When looping from a start to end value I would expect that to
work correctly without the need to test and write special code to handle
using min/max integer values in loops! :)
[snip]

--
Cheers,
Kein-Hong Man (esq.)
Selangor, Malaysia