Standard ML Palindrome without reversing the list
<p>I am new to SML and don't understand too about the syntax.</p>

<p>I am doing a practice on checking palindrome without reversing the list. Here is my code</p>

<pre><code>fun symmetric(i,n,inlist) = 
if List.nth(inlist,i-1) = List.nth(inlist,n-i)
    then true
else
    false;

fun palindrome(n, inlist) = 
let 
    val i = ref 1
in
    while !i &lt; n do (
        if symmetric(!i,!n,!inlist) = false
            then false
        else ()
        i := !i + 1
    )
    true
end;
</code></pre>

<p>I got errors in fun palindrome only, but can't fix it by myself.</p>