lua-users home
lua-l archive

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


On Fri, Dec 18, 2009 at 1:27 PM, Jeff Pohlmeyer
<yetanothergeek@gmail.com> wrote:
> table.sort(t, function (a, b) A=a:upper() B=b:upper() return A==B and a<b or A<B end);

a<b can be false, so the implicit-if is not appropriate. You'd have to
use an explicit-if:

table.sort(t, function (a, b)
  local A,B =a:upper(), b:upper()
  if A == B then return a < b
  else return A < B
end end)