lua-users home
lua-l archive

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




On 28/02/2012 11:20 PM, Dirk Laurie wrote:
-- sort in the wrong order
>  table.sort(T,|x,y|(x>  y))
>
Easier to write, maybe.  But really easier to read than this?

down = function(x,y) return x>y end
table.sort(T,down)

Yes. Much easier.

Ross.