title: Prolog getting head and tail of string
body: <p>I'm trying to wrap my brain around Prolog for the first time (SWI-Prolog) and I'm struggling with what I'm sure are the basics. I'm trying to take a string such as "pie" and print out the military NATO spelling of it to look something like this:</p>
  
  <pre><code>spellWord("Pie").
  Papa
  India
  Echo
  </code></pre>
  
  <p>Currently I'm just trying to verify that I'm using the [H|T] syntax and Write function correctly. My function is:</p>
  
  <pre><code>spellWord(String) :- String = [H|T], writeChar(H), spellWord(T).
  
  writeChar(String) :- H == "P", print4("Papa").
  </code></pre>
  
  <p>When making a call to <code>spellWord("Pie")</code>. this currently just returns false.</p>