title: warning 10 : this expression should have type unit
body: <p>I'm writing a program in ocaml containing some loops "for", my problem is that for each of these cycles you receive this message: "warning 10 : this expression should have type unit. "</p>
  
  <p>Example :</p>
  
  <pre><code>    let f q p rho= 
  
         let x = [] in  
         if q &gt; p then
            for i=0 to rho do
                x= q :: x
            done;    
      x;;
  </code></pre>
  
  <p>this every time I use a cycle "for" ,how can I solve this problem?</p>