annotate samples/fib.tp @ 105:35006a6e1c47

Fixed more editor coderot and improved syntax/selection coloring a bit.
author Mike Pavone <pavone@retrodev.com>
date Thu, 11 Apr 2013 09:16:35 -0700
parents 3a169ebb3224
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
02b20292f187 Added fib sample
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1 #{
02b20292f187 Added fib sample
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
2 fib <- :n {
02b20292f187 Added fib sample
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
3 if: n < 2 {
02b20292f187 Added fib sample
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
4 1
02b20292f187 Added fib sample
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
5 } else: {
02b20292f187 Added fib sample
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
6 (fib: n-1) + (fib: n-2)
02b20292f187 Added fib sample
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
7 }
02b20292f187 Added fib sample
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
8 }
02b20292f187 Added fib sample
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
9
02b20292f187 Added fib sample
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
10 main <- {
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
Mike Pavone <pavone@retrodev.com>
parents: 10
diff changeset
11 print: (string: (fib: 30)) . "\n"
10
02b20292f187 Added fib sample
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
12 }
02b20292f187 Added fib sample
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
13
02b20292f187 Added fib sample
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
14 }