diff options
Diffstat (limited to 'tex/context/base/l-boolean.lua')
-rw-r--r-- | tex/context/base/l-boolean.lua | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tex/context/base/l-boolean.lua b/tex/context/base/l-boolean.lua index cf92d2f41..3fff7c126 100644 --- a/tex/context/base/l-boolean.lua +++ b/tex/context/base/l-boolean.lua @@ -11,8 +11,12 @@ local type, tonumber = type, tonumber boolean = boolean or { } local boolean = boolean +-- function boolean.tonumber(b) +-- return b and 1 or 0 -- test and test and return or return +-- end + function boolean.tonumber(b) - if b then return 1 else return 0 end + if b then return 1 else return 0 end -- test and return or return end function toboolean(str,tolerant) @@ -36,6 +40,8 @@ function toboolean(str,tolerant) end end +string.toboolean = toboolean + function string.is_boolean(str,default) if type(str) == "string" then if str == "true" or str == "yes" or str == "on" or str == "t" then @@ -46,11 +52,3 @@ function string.is_boolean(str,default) end return default end - -function boolean.alwaystrue() - return true -end - -function boolean.falsetrue() - return false -end |