lua-users home
lua-l archive

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


> 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 :)