I'm facing trouble getting this assignment to work out. We are supposed to take command line arguments as input and write them out to a file. So far I have done below code:
val args = CommandLine.arguments()
val a = length args;
val os = TextIO.openOut "rodr4719.txt";
TextIO.output(os, "rodr4719");
fun writeFile(os, args, a) =
if a = -1 then
TextIO.output(os, "rodr4719")
TextIO.closeOut os
OS.Process.exit(OS.Process.success)
else
val str = nth (args, a);
TextIO.output(os, str ^"\n" );
a = a-1;
writeFile(os, args, a)
end;
writeFile(os, args, a-1)
and the error I am getting is
.sml:22.1 Error: syntax error: inserting EQUALOP