[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Sort function modifies the table being sorted?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Thu, 14 Jun 2012 07:54:18 +0200
2012/6/14 Paul K <paulclinger@yahoo.com>:
> I suspect so too, but (1) it's not stated anywhere that it's against
> the rules and (2) changing to "o[a] and 0 or 9" fixes it, which should
> make no difference.
It does make a difference. In the course of the sorting process, you reach
a point where o[a] does not exist. As coded now, you will get 0, before
you would have got 9. 0 is not logically false in Lua.