Quick question; program will not compile; and I tried for hours to get it
to work.
Any help would be appreciated.
All I want is to read text from a file...; thanks.
clean 515>make
clm -h 20m zip -o zip
Compiling zip
Error [zip.icl,6,readzipcode]: FileSystemM:11 type context should contain
one or more type variables
make: *** [zip] Error 1
clean 515>
----------------
module zip
import StdEnv, StdFile, StdOrdList, StdList, StdInt, StdReal
inputfilename :== "zip.txt"
readzipcode :: String *File -> ((Int, Char, Char), *File) | FileSystem File
readzipcode inputfilename files
# (readok, infile, files) = sfopen inputfilename FReadText files
| not readok = abort ("Cannot open input file: '" +++ inputfilename +++ "'")
# (b1, i, files) = freadi infile
# (b2, c1, files) = freadc infile
# (b3, c2, files) = freadc infile
| (b1 && b2 && b3) = ((i, c1, c2), files)
Start :: *World -> ((Int, Char, Char), *World)
Start ((int, ch1, ch2), world) = readzipcode inputfilename world
_______________________________________________
clean-list mailing list
[email protected]
http://mailman.science.ru.nl/mailman/listinfo/clean-list