I am currently learning SML functional language and I am trying to make a function that takes a list of characters then it searches for any white spaces in the list when it finds a white space it concatinates the characters before the white space to make a string after that it returns a list of strings that are made of characters split by white spaces.
Here is my code but there is something wrong with it the compiler says that there is an error at eof !
fun sepWords ([]) = []
| sepWords (x :: xs) =
let
val word = ""
val list
sepWords (xs)
in
if (Char.isSpace (x)) then (word = "")
else (word ^ x)
word :: list
end;