lua-users home
lua-l archive

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


Veering off topic slowly but surely, but I suppose the way I would approach that is to give the comparison function a descriptive name. LessThan, GreaterThan, or the like, and maybe keep it in the global scope. Then you could justify it by calling it a "predicate." =) I wouldn't call that inelegant.

On 9/6/07, Patrick Donnelly <batrick.donnelly@gmail.com> wrote:
I see now thanks. Perhaps an inline function addition would be nice,
though it seems to be an almost distasteful addition. I just find
these constructs inelegant:

local x = function(a, b) end
function sort()
  table.sort(sometable, x)
end

--
-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."

-Will Durant