* `if` builtin is the big one here - branching! Yay! * The `if` builtin requires __bool__ to be implemented for things. This is added for all builtin objects. * Vtables have slightly better ergonomics. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
7 lines
441 B
Plaintext
7 lines
441 B
Plaintext
[ "fail - 0 is not truthy" println! ] [ "OK" println! ] 0 if!
|
|
[ "OK" println! ] [ "fail - 1 is truthy" println! ] 1 if!
|
|
[ "OK" println! ] [ "fail - 1.1 is truthy" println! ] 1.1 if!
|
|
[ "OK" println! ] [ "fail - 0.1 is truthy" println! ] 0.1 if!
|
|
[ "OK" println! ] [ "fail - -0.1 is truthy" println! ] -0.1 if!
|
|
[ "fail - -0.0 is not truthy" println! ] [ "OK" println! ] -0.0 if!
|
|
[ "fail - 0.0 is not truthy" println! ] [ "OK" println! ] 0.0 if! |