title: Defining a variable within a function in OCaml
body: <p>I've got a function numofday that I'd like to apply to two variables in another function that will return the number of days between the two given days, the functions themselves don't really matter, I guess this is more of a syntactic question but google didn't produce much.</p>
  
  <p>What I want to do is something like (and this is what I tried that obviously did not work)</p>
  
  <pre><code>let daysbetween day1 day2 =
   let x = numofday day1;
   let y = numofday day2;
   x-y;;
  </code></pre>
  
  <p>I've tried removing let, removing semicolons, and using := instead of = and I just can't seem to get it to work. There has to be a way to define variables within a function. Thanks in advance.</p>