Add branching and more coherent method of function calls
We're turing-complete, babey! * Call stack for functions now differentiates between native and quote calls * Better API for builtin functions allowing for more control * Example showing off branches Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
7
examples/branch.sy
Normal file
7
examples/branch.sy
Normal file
@@ -0,0 +1,7 @@
|
||||
0 [ "fail - 0 is not truthy" . ] [ "OK" . ] if!
|
||||
1 [ "OK" . ] [ "fail - 1 is truthy" . ] if!
|
||||
1.1 [ "OK" . ] [ "fail - 1.1 is truthy" . ] if!
|
||||
0.1 [ "OK" . ] [ "fail - 0.1 is truthy" . ] if!
|
||||
-0.1 [ "OK" . ] [ "fail - -0.1 is truthy" . ] if!
|
||||
-0.0 [ "fail - -0.0 is not truthy" . ] [ "OK" . ] if!
|
||||
0.0 [ "fail - 0.0 is not truthy" . ] [ "OK" . ] if!
|
||||
Reference in New Issue
Block a user