Version française
Home     About     Download     Resources     Contact us    
Browse thread
Difference between "let rec" and just "let"?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Andrej Bauer <Andrej.Bauer@a...>
Subject: Re: [Caml-list] Difference between "let rec" and just "let"?
Jean Krivine wrote:
> Each time you use let, you can also use let rec,

Not quite. For example:

let x = 5 in
let x = x + 10 in
  x

is not equivalent to

let rec x = 5 in
let rec x = x + 10 in
  x

(In fact the second one doesn't compile.)

Andrej