Mercurial > repos > tabletprog
comparison samples/fib.tp @ 44:9dd370530f69
Fix escape codes in string literals. Don't print out the return value of main method. Fixup fib example to use print: method. Cleanup error handling in compiler slightly
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 12 Jul 2012 22:49:08 -0700 |
parents | 02b20292f187 |
children | 3a169ebb3224 |
comparison
equal
deleted
inserted
replaced
43:27a2167663dd | 44:9dd370530f69 |
---|---|
1 #{ | 1 #{ |
2 | |
3 console <- foreign: #{ | |
4 log <- foreign: :val {} | |
5 } | |
6 | |
7 true <- #{ | 2 true <- #{ |
8 if:else <- :self trueblock :elseblock { | 3 if:else <- :self trueblock :elseblock { |
9 trueblock: | 4 trueblock: |
10 } | 5 } |
11 } | 6 } |
23 (fib: n-1) + (fib: n-2) | 18 (fib: n-1) + (fib: n-2) |
24 } | 19 } |
25 } | 20 } |
26 | 21 |
27 main <- { | 22 main <- { |
28 console log: (fib: 30) | 23 print: (string: (fib: 30)) . "\n" |
29 } | 24 } |
30 | 25 |
31 } | 26 } |