I'm having a continuous error pop when I try to run this program in ML:
fun find(s,file) =
let fun findHelper(true, true, ch, w, file, acc, acc2) = TextIO.output(TextIO.stdOut, acc2^"\n")
| findHelper(b1, b2, ch, w, file, acc) = ch = valOf(TextIO.input1(TextIO.file)) acc2^str(ch)
if ch = "" then
if w = acc then b1 = true
else acc = ""
else if ch = "\n" then b2 = true
else acc^str(ch)
in
findHelper(false, false, "", s, file, "", "")
end
The error code is:
project.sml:61.3 Error: syntax error: inserting LPAREN
project.sml:65.12 Error: syntax error: inserting RPAREN
I've inserted a bunch of parenthesis to no avail and honestly, I don't even know why this error popped. The error is centering around the "if ch = "" then" , but there is no error for the other instance of ch, so I don't know why it error'd one and not the other.