mirror of
https://github.com/appgurueu/modlib.git
synced 2024-08-18 20:34:10 +02:00
Func: Add properly named aliases for logical ops
This commit is contained in:
parent
756867495f
commit
91fed867a1
15
func.lua
15
func.lua
@ -220,17 +220,14 @@ end
|
|||||||
|
|
||||||
-- Functional wrappers for logical operators, suffixed with _ to avoid a syntax error
|
-- Functional wrappers for logical operators, suffixed with _ to avoid a syntax error
|
||||||
|
|
||||||
function not_(a)
|
function not_(a) return not a end
|
||||||
return not a
|
_ENV["not"] = not_
|
||||||
end
|
|
||||||
|
|
||||||
function and_(a, b)
|
function and_(a, b) return a and b end
|
||||||
return a and b
|
_ENV["and"] = and_
|
||||||
end
|
|
||||||
|
|
||||||
function or_(a, b)
|
function or_(a, b) return a or b end
|
||||||
return a or b
|
_ENV["or"] = or_
|
||||||
end
|
|
||||||
|
|
||||||
-- Export environment
|
-- Export environment
|
||||||
return _ENV
|
return _ENV
|
Loading…
Reference in New Issue
Block a user