Skip to content

Commit

Permalink
[fix] Doc/refcard: few fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
akoprow committed Apr 30, 2012
1 parent 7dc22e8 commit 7edcd80
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions opadoc/refcard.omd
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Expressions
#### Function declarations

// function declaration
function incr(int x) : int
function int incr(int x)
{
x + 1
}
Expand All @@ -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
Expand Down

0 comments on commit 7edcd80

Please sign in to comment.