summaryrefslogtreecommitdiff
path: root/tex/context/base/l-boolean.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2010-10-29 13:00:23 +0300
committerMarius <mariausol@gmail.com>2010-10-29 13:00:23 +0300
commit42c4d16ce1daa37425d12be6c87d6f64a72b5094 (patch)
tree494b8c10ccef29abe26db9acf08261ce78c16cf6 /tex/context/base/l-boolean.lua
parentf56f0054360a9bdfb57de9abcf0d81a2766c22b9 (diff)
downloadcontext-42c4d16ce1daa37425d12be6c87d6f64a72b5094.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.lua16
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