diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-10-29 11:35:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-10-29 11:35:00 +0200 |
commit | 2e3932acbaa9da37885abbbd1f449a110c06f9a1 (patch) | |
tree | 3a4b1c5a08129cd5881cd8f8758b0ebd2fb4f80d /tex/context/base/l-boolean.lua | |
parent | a1bbb1605334a1209f43625c174ba50ad698235e (diff) | |
download | context-2e3932acbaa9da37885abbbd1f449a110c06f9a1.tar.gz |
beta 2010.10.29 11:35
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 |