[clean-list] Maybe I should change my job and apply for the pope-position

Siegfried Gonzi siegfried.gonzi@kfunigraz.ac.at
Sat, 13 Oct 2001 11:56:45 +0200


Fabien Todescato wrote:

> There you are, and let god forgive me.

Got saves you my son! Thank you again. A small remark: To use your
modules on the Macintosh (and maybe on the Sun) one has to augment the
"tslReal.icl" file with the follwoing:

==
implementation module tslReal
import StdEnv
 
//from arrays import listToCharUnboxedArray // Private array utility
module. 
//from StdEnv import String , +++ , while , < , ~ , == , > , / ,
toString , toInt , entier , + , - , o , <> , mod , //not , * , toChar ,
toReal , map , snd , take , length , iter , ^ , ++ , repeat , repeatn
 
 
arrayToList:: String -> [!Char]
arrayToList string = arrayToList_i 0 string
where
        arrayToList_i:: !Int String -> [!Char]
        arrayToList_i n string=:{ [n] = nk }
        | n == (size string) = []
        = [ nk : arrayToList_i (n+1) string ] 
 
 
listToCharUnboxedArray :== toString
==

and therefore in "tslReal.dcl":

==
definition module tslReal

//from StdEnv import String
import StdEnv

arrayToList:: String -> [!Char]
==


All the other things should remain unchanged. I think on the Macintosh
there is no function, which converts a string to an char-list. But one
can easily implement it yourself (see above). And it seems that
"toString" (which is native to Clean) is the same as your
listToCharUnboxedArray.

One can also play around and test whether giving strictness information
to the strings ("!String") in your module is a performance boost or not;
maybe of interest for handling big files.


Aufwiederschaun,
S. Gonzi