aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'global-functions.rsc')
-rw-r--r--global-functions.rsc4
1 files changed, 1 insertions, 3 deletions
diff --git a/global-functions.rsc b/global-functions.rsc
index 4f37fa5..41120fd 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -382,15 +382,13 @@
:set EitherOr do={
:global IfThenElse;
- :if ([ :typeof $1 ] = "bool") do={
- :return $1;
- }
:if ([ :typeof $1 ] = "num") do={
:return [ $IfThenElse ($1 != 0) $1 $2 ];
}
:if ([ :typeof $1 ] = "time") do={
:return [ $IfThenElse ($1 > 0s) $1 $2 ];
}
+ # this works for boolean values, literal ones with parentheses
:return [ $IfThenElse ([ :len [ :tostr $1 ] ] > 0) $1 $2 ];
}