From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA15395 for caml-redistribution; Tue, 2 Mar 1999 18:09:43 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA05786 for ; Tue, 2 Mar 1999 14:04:25 +0100 (MET) Received: from julie.univ-savoie.fr (univax.univ-savoie.fr [193.48.120.32]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id OAA23030 for ; Tue, 2 Mar 1999 14:04:23 +0100 (MET) Received: from univ-savoie.fr (raffalli@lama-d134.univ-savoie.fr [193.48.123.134]) by julie.univ-savoie.fr (8.9.3/jtpda-5.3.1) with ESMTP id OAA61431 ; Tue, 2 Mar 1999 14:06:00 +0100 (CET) Sender: weis Message-ID: <36DBE258.E34BC8C8@univ-savoie.fr> Date: Tue, 02 Mar 1999 14:06:32 +0100 From: Christophe Raffalli Organization: =?iso-8859-1?Q?Université?= de Savoie X-Mailer: Mozilla 4.5 [en] (X11; I; Linux 2.0.33 i586) X-Accept-Language: en MIME-Version: 1.0 To: "Sumlssillo, David" , caml-list@inria.fr Subject: Re: callcc/throw... References: <36DACA20@smtp.ftintl.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit If you really need callcc/throw (that is try ... with ... is not enough), this means you are implementing an algorithm which is bactracking. callcc needs to save the current stack. this is not very hard as you can copy only the first page of the stack and delay the other copy when needed. However this keeps a lot of pointer and will often leads to a lot of memory leaks. Indeed the stack may contains value that are not related to your backtracking or that could be recomputed easely. It is often better (not always) to directly implement your algorithm with the bactracking explicit (that is keeping a stack of state from which you can backtrack). The code is often more difficult to write (you are doing a CPS translation by hand) but you can gain a lot by - keeping only what is needed in the state - not keeping the state from which you know you do not need to backtrack (most of the time you have a lot of these which are preserved in the stack if you use callcc) Christophe Raffalli