title: SML syntax error help
body: <p>In the following sections of code I am receiving errors that I am not sure why I am getting them despite using all of my resources to research them.  This is SMLNJ coding.</p>
  
  <pre><code>compComm (DeallocComm(var, exp), env, ip, codes, contIP)=
   let val loc = lookupEnv var env;
    val codes1 = emitByte(LDC, ip, codes);
    val codes2 = emitByte(Arg loc, ip + 1, codes1);
    val (ip', codes3) = compExp(exp, env, ip+2, codes2);
    val codes4 = emitByte(ADEALLOC, ip', codes3);
     in(ip'+1, codes4, nil, contIP)
    end;
  </code></pre>
  
  <p>gives</p>
  
  <p>hw4.sml:339.5-433.6 Error: non-constructor applied to argument in pattern: DeallocComm
  hw4.sml:427.26-427.29 Error: unbound variable or constructor: var</p>
  
  <p>hw4.sml:430.31-430.34 Error: unbound variable or constructor: exp</p>
  
  <p>and</p>
  
  <pre><code>ADEALLOC =&gt; let val (n, stack') = popStack stack
   val (loc, stack'') = popStack stack';
   fun loop'(n, loc, store) =
    val store' = updateTable (loc, defaultIntValue, store);
    in loop'(n-1, loc+1, store) =
     val store'' = loop'(n, loc, store) end;
   in loop(ip+1, store'', stack'') end;
  </code></pre>
  
  <p>gives</p>
  
  <p>hw4.sml:612.14 Error: syntax error: inserting  EQUALOP</p>
  
  <p>hw4.sml:615.8-615.11 Error: syntax error: replacing  VAL with  END</p>
  
  <p>any help on these would be appreciated.</p>