fun readlist is l (NONE) = ([]; TextIO.closeIn; l) | readlist is l (SOME(s)) = let val i = valOf(Int.fromString(s)) in readlist is (l @ [i])(TextI