From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id NAA09854 for caml-redistribution; Mon, 20 Nov 1995 13:52:10 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id NAA09422 for ; Mon, 20 Nov 1995 13:06:35 +0100 Received: from ra.abo.fi (ra.abo.fi [130.232.18.2]) by concorde.inria.fr (8.7.1/8.6.9) with SMTP id NAA10964 for ; Mon, 20 Nov 1995 13:06:28 +0100 (MET) Received: from tanichka.abo.fi (root@tanichka.abo.fi [130.232.209.102]) by ra.abo.fi (8.6.10/8.6.10) with ESMTP id OAA13786; Mon, 20 Nov 1995 14:03:47 +0200 Received: from tanichka.abo.fi (jharriso@localhost [127.0.0.1]) by tanichka.abo.fi (8.6.10/8.6.10) with ESMTP id OAA20531; Mon, 20 Nov 1995 14:04:20 +0200 Message-Id: <199511201204.OAA20531@tanichka.abo.fi> To: Xavier Leroy cc: jharriso@ra.abo.fi (John Harrison), caml-list@pauillac.inria.fr Subject: Re: CAML Light system functions etc. In-reply-to: Your message of "Mon, 20 Nov 1995 11:16:47 EET." <199511201016.LAA07901@pauillac.inria.fr> Date: Mon, 20 Nov 1995 14:04:13 +0200 From: John Harrison Sender: weis | > (1) Is there an interface to "tempnam" or something similar? (For creating | > unique temporary filenames). I looked in the "unix" library but couldn't | > find anything -- I think it'd be a convenient addition. | | It is a SMOP (Small Matter Of Programming). Here is the function I use: Yes, I ended up doing something using the PID. But then most library functions are a SMOP; it still seems reasonable to provide the ones that users are going to need. At least you and I needed this one. | > it's neither pleasant nor efficient to always have to worry | > about signal exceptions popping up. | | Shall I read this as ``I use (try ... with _ -> ...) all the time because | I'm too sloppy to figure out exactly which exceptions I should trap'' ? | That's a dangerous thing to do, since any heap allocation can trigger | the Out_of_memory exception. That's an all-too-accurate reading! Except that I could perfectly well have a common exception "MYERR" and just use "try ... with MYERR(_) -> ...". I wouldn't object to the extra typing, but I guess it would be significantly less efficient. Is that true? I suppose I could try it and find out. | > (3) Is there some hook to allow a user-defined function to be called after | > the evaluation and printing of each toplevel phrase? This would be nice for | > reporting run statistics etc. | | No, there isn't. Well, since you excel at reading between the lines, you can read my question as "what a great idea it would be to add some hook... wouldn't it?" My guess is that it would be easy for a CAML-Light expert to add, since the interpreter's read-eval-print loop itself seems to be written in CAML. Cheers, John.