lua bagaimana nilai default jika nil

function foo(x, y, z)
    x = (x == nil) or x
    y = (y == nil and 1234) or y
    z = (z == nil and "default") or z
    print(x, y, z)
end

> foo()
true    1234    default
> foo(false, false, "me")
false   false   me
> foo(nil, 50, "me")
true    50  me
Tense Tern