Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function isTruthy(arg) --[[ could be shortened as
- if arg then
- return true
- else
- return false
- end ]]
- if arg == nil then
- return false
- elseif arg == false then -- Could have used or if we were not dong this to redefine things
- return false
- else
- return true
- end
- end
- local function Or(left, right)
- if isTruthy(left) then
- return left
- else
- return right
- end
- end
- local function And(left, right)
- if isTruthy(left) then
- return right
- else
- return left
- end
- end
Add Comment
Please, Sign In to add comment