diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/intro.ur | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/intro.ur b/doc/intro.ur index 770b7b06..b08e2395 100644 --- a/doc/intro.ur +++ b/doc/intro.ur @@ -58,12 +58,15 @@ fun fact n = if n = 0 then 1 else n * fact (n - 1) fact 5 (* end *) -fun isEven n = n = 0 || isOdd (n - 1) -and isOdd n = n = 1 || isEven (n - 1) +fun isEven n = n = 0 || (n > 1 && isOdd (n - 1)) +and isOdd n = n = 1 || (n > 1 && isEven (n - 1)) (* begin eval *) isEven 32 (* end *) +(* begin eval *) +isEven 31 +(* end *) (* Of course we have anonymous functions, too. *) |