is there a shortened "if then" syntax available in Lua?

lua

Solution

To represent `x = a ? b : c`, the lua-users wiki suggests:

A frequently used and highly recommend solution is to combine the `and` and `or` binary operators in a way that closely approximates the ternary operator:

x = a and b or c

To represent `x = a ? b : c ? d : e`, the wiki further suggests:

x = a and b or c and d or e

WARNING: This technique may fail if `b` or `d` are ever `nil` or `false`.

Problem

Is there a shorted "if / then" syntax available in Lua (I'm using Corona SDK specifically), like in some other languages... In particular along the lines of: ``` res = (a == b) ? "It worked" : "It did NOT work" ```

Original source