-- action: run -- outcome: success -- expect: 55.0 -- create the syntax for an if statement syntax 'if condition do 'else otherwise { -- the ffi will return `do` or `otherwise` depending on condition branch = magic "if" ( condition, { () -> do }, { () -> otherwise }, ) -- call the branch branch () } syntax a 'or b { magic "if" (a, true, b, ) } syntax 'not a { magic "if" (a, false, true, ) } syntax a 'equals b { magic "equal" (a, b) } syntax 'while condition do { test = () -> condition l = () -> { recurse = magic "if" ( test (), { () -> { do; l () } }, { () -> () }, ) recurse () } l () } println_no_line = x -> magic "println" x println "starting" -- a simple recursive fibonacci implementation fib = n -> { base = { n equals 0.0 } or { n equals 1.0 } if (not base) { fib (n - 1.0) + fib (n - 2.0) } else { 1.0 } } fib 9.0