[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: yielding in table.sort sorting functions
- From: Marcus Mason <m4gicks@...>
- Date: Fri, 24 Sep 2021 03:50:23 +0100
> On top of that, a sorting function really should just be quickly comparing basic object elements and returning a boolean. A sorting function that needs to do advanced things like yielding is highly questionable to begin with.
I don't see anything wrong with yielding in this place in general, but
I can agree this algorithm as written would be hard to rewrite. Is
yielding in an xpcall handler more appropriate than a sorting
function?
> The answer is: you can't, at least not without mountains of extra code
I can use a pure lua sorting function to remedy this :)