view samples/fib.tp @ 47:cd41f7c22fcd

Remove compiled hello and private samples and add source
author Mike Pavone <pavone@retrodev.com>
date Fri, 13 Jul 2012 08:50:10 -0700
parents 9dd370530f69
children 3a169ebb3224
line wrap: on
line source
#{
true <- #{
  if:else <- :self trueblock :elseblock {
    trueblock:
  }
}

false <- #{
  if:else <- :self trueblock :elseblock {
    elseblock:
  }
}

fib <- :n {
  if: n < 2 {
    1
  } else: {
    (fib: n-1) + (fib: n-2)
  }
}

main <- {
  print: (string: (fib: 30)) . "\n"
}

}