From 91fed867a13fb17277dd500271c2758b9cdc8df6 Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Fri, 19 Aug 2022 18:20:04 +0200 Subject: [PATCH] Func: Add properly named aliases for logical ops --- func.lua | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/func.lua b/func.lua index 330f462..f587deb 100644 --- a/func.lua +++ b/func.lua @@ -220,17 +220,14 @@ end -- Functional wrappers for logical operators, suffixed with _ to avoid a syntax error -function not_(a) - return not a -end +function not_(a) return not a end +_ENV["not"] = not_ -function and_(a, b) - return a and b -end +function and_(a, b) return a and b end +_ENV["and"] = and_ -function or_(a, b) - return a or b -end +function or_(a, b) return a or b end +_ENV["or"] = or_ -- Export environment return _ENV \ No newline at end of file