> 1. I found In many cases there is no "function" key word.
> 2. And how do we differentiate with evaluation?
>
> beginner, thanks!
>
> #let rec fib n =
> # if n < 2 then 1 else fib(n-1) + fib(n-2);;
> val fib : int -> int = <fun>
I doubt it makes a lot of difference in generated machine code if
you write things this way, defining a closure without using any
parameter :
let rec fib = function
n -> if n < 2 then
1
else
fib(n-1) + fib(n-2);;
> I didn't find specific description in doc and only could learn from
codes.
Maybe Oreilly book [CMP00] could help ?
In first page, you have an index of keywords that references "function".
.