For instance in Lua:
function abs(x) test = { [true]=-x, [x>0]=x, [x==0]=0} return test[true] end > print (abs(-3)) 3
It's not the best way to do this, but maybe it'will help understand the above construct.
test[true]()
For instance in Lua:
To understand this code, think that `test[true]` is overwritten at initialization time by the last predicate to evaluate to True.It's not the best way to do this, but maybe it'will help understand the above construct.