[clean-list] Easter Egg

Siegfried Gonzi siegfried.gonzi@kfunigraz.ac.at
Fri, 14 Sep 2001 17:28:57 +0200


1. The string delimiter "\n" is only valid on the Macintosh, e.g if you have got a file with:

asasd
assdsda
dssddas
1.23    122.33    23.33
12.23    2.93.    9.33
23.33    23.3    243.3
999

and you read line after line and want stop at: line==999

CountLines:: !File -> !Int
CountLines file = ReadLines 0 file
where
                ReadLines:: !Int !File -> !Int
                ReadLines nLines file
                                #! (line,filerest) = sfreadline file
                                | line == "999" = nLines
                                = ReadLines (nLines + 1) filerest

then *this* is only valid on the Sun and on Windows!

2. On the Macintosh the above example would deliver as number of lines a value of 7 BUT on the Sun or on Windows one get 6!

3. A few days ago I posted a file-reading program which reads the above file-scheme. On the Mac everything worked okay but on the Sun it is impossible to get appropiate values and on Windows the programm delivers always the first array value as NaN:


({{#NAN,122.33,23.33},{12.23,2.93,9.33},{23.33,23.3,243.3}})

4. It is NOT documented that between: Macintosh, Unix and Windows there is a notable difference between the file handling procedure!


S. Gonzi