This commit is contained in:
zeroflag 2021-07-02 14:21:11 +02:00
parent 59ccc85f92
commit c188719c08
2 changed files with 6 additions and 2 deletions

View file

@ -228,7 +228,10 @@ public class Num implements Obj, LogicOperand, ArithmeticOperand {
@Override
public boolean boolValue() {
throw new TypeMismatched(this, "bool");
if (STRICT)
throw new TypeMismatched(this, "bool");
else
return value.longValue() != 0l;
}
@Override

View file

@ -15,4 +15,5 @@
: ms ( n -- ) 'java.lang.Thread/sleep/l' jvm-call-static ;
: tone ( hz ms -- ) swap 'com.vectron.forthcalc.support.Tone/play/di' jvm-call-static ;
: tone ( hz ms -- ) swap 'com.vectron.forthcalc.support.Tone/play/di' jvm-call-static ;
: torch ( n -- ) 'com.vectron.forthcalc.support.Torch/toggle/O' jvm-call-static ;