Adrien Pierard wrote:
do I have to do the display in the IO monad ?
You usually want to be sure that your IO actions are completing as planned or take a recovery path if they don't. Completing includes (flushing and) closing the file, so that you get to know from the OS whether the content still fits onto the filesystem, your quota is used up, the disk failed, the network with the volume just vanished... You have to describe to the Scheme system how to deal with those situations (e.g. provide code). The Gambit IO functions are calling your current-exception-handler for this purpose. If you want the Scheme system to flush/close your files at other moments (asynchronically), you still have to tell it which code to run; make-will being Marc's suggestion (I think you have to reinstall your current-exception-handler there (using with-exception-catcher)). Usually it's more straight-forward to deal with writing/flushing/closing (all including possible error handling) in sequence than doing the last step(s) asynchronically.
Christian.