title: OCaml while true do loop
body: <p>I have the following code:</p>
  
  <pre><code>let a = 1 in
  while a&lt;10 do
    let a = a+1 in
  done
  Printf.printf "the number is now %d\n" a
  </code></pre>
  
  <p>The interpreter is complaining about line 4, which is <code>done</code> and I have no idea what is wrong here. <br />
  I understand that OCaml is a functional language and the variables are immutable. I should not try to change the value of <code>a</code> here. 
  But still, there is a <code>while true do .. done</code> loop in OCaml. I hope you get the idea of what I am trying to do here. How shall I modify the code to do this job with <code>while true do .. done</code>?
  <br />
  I am very new to functional programming. Please teach me the right way to get started with it. I find myself stuck in the deadlock of thinking imperatively. </p>