[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [OT] Swiftly return multiple values
- From: Dirk Laurie <dirk.laurie@...>
- Date: Thu, 5 Jun 2014 08:55:22 +0200
2014-06-05 0:10 GMT+02:00 Jay Carlson <nop@nop.com>:
> sortedStrings = stringArray:sorted(function (a,b)
> return a:uppercaseString() < b:uppercaseString()
> end)
Personally, though that sort of code is legal Lua, I find
it obfuscated.
function ALPHABETICALLY(a,b)
return a:uppercaseString() < b:uppercaseString()
end
-- ... 1000 lines of code later
sortedStrings = stringArray:sorted(ALPHABETICALLY)
When you read that line, no need to wonder what it means.