title: printing string and calling recursive function
body: <p>I am currently learning sml but I have one question that I can not find an answer for. I have googled but still have not found anything. </p>
  
  <p>This is my code: </p>
  
  <pre><code>fun diamond(n) =
    if(n=1) then (
      print("*")
    ) else (
  
      print("*")
      diamond(n-1)
  
    )
  
  diamond(5);
  </code></pre>
  
  <p>That does not work. I want the code to show as many * as number n is and I want to do that with recursion, but I don't understand how to do that. </p>
  
  <p>I get an error when I try to run that code. This is the error: </p>
  
  <blockquote>
    <p>Standard ML of New Jersey v110.78 [built: Thu Aug 20 19:23:18 2015]
    [opening a4_p2.sml] a4_p2.sml:8.5-9.17 Error: operator is not a
    function [tycon mismatch]   operator: unit   in expression:
        (print "*") diamond /usr/local/bin/sml: Fatal error -- Uncaught exception Error with 0  raised at
    ../compiler/TopLevel/interact/evalloop.sml:66.19-66.27</p>
  </blockquote>
  
  <p>Thank you</p>