Permalink
Browse files

[fix] Doc/refcard: few fixes.

  • Loading branch information...
akoprow committed Apr 30, 2012
1 parent 7dc22e8 commit 7edcd8003d237f3b10dff1f71667e6c3b374af85
Showing with 5 additions and 4 deletions.
  1. +5 −4 opadoc/refcard.omd
View
@@ -75,7 +75,7 @@ Expressions
#### Function declarations
// function declaration
- function incr(int x) : int
+ function int incr(int x)
{
x + 1
}
@@ -93,9 +93,10 @@ Expressions
// anonymous function
function(x) { x + 1 }
- // mutually recursive functions
- rec function odd(x) { if x == 1 then true else even(x-1) }
- and function even(x) { if x == 0 then true else odd(x-1) }
+ // mutually recursive functions; 'recursive' and 'and' only
+ // needed for *local* functions (not needed at top-level)
+ recursive function odd(x) { if (x == 1) true else even(x-1) }
+ and function even(x) { if (x == 0) true else odd(x-1) }
//[TODO]: Add recursive functions
//[TODO]: Add partial application

0 comments on commit 7edcd80

Please sign in to comment.