Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[fix] Doc/refcard: few fixes.

  • Loading branch information...
commit 7edcd8003d237f3b10dff1f71667e6c3b374af85 1 parent 7dc22e8
@akoprow akoprow authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 opadoc/refcard.omd
View
9 opadoc/refcard.omd
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.