[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: weird behaviour of table.sort
- From: Wolfgang Pupp <wolfgang.pupp@...>
- Date: Mon, 28 Jun 2010 20:05:53 +0200
I don't expect valid results from invalid code.; I just hope for
meaningful errors.
If your comparison function crashes (and it probably will, because of
the unexpected nil argument), you'll never get the helpful 'invalid
order function for sorting', but a 'trying to index nil' or sth. like
that.
Result: You'll look for the wrong kind of error in the wrong place.
If Lua knows that my comparison function is flawed (and it most
obviously does), it should tell me just that, instead of pestering my
poor function with bogus arguments just to see what happens.