From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA31295 for caml-redistribution; Tue, 14 Dec 1999 08:50:14 +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 SAA17099 for ; Mon, 13 Dec 1999 18:27:40 +0100 (MET) Received: from labrador.eecs.harvard.edu (labrador.eecs.harvard.edu [140.247.60.247]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id SAA25976 for ; Mon, 13 Dec 1999 18:27:37 +0100 (MET) Received: (from nr@localhost) by labrador.eecs.harvard.edu (8.9.3/8.9.3) id MAA20344; Mon, 13 Dec 1999 12:27:37 -0500 Date: Mon, 13 Dec 1999 12:27:37 -0500 From: Norman Ramsey Message-Id: <199912131727.MAA20344@labrador.eecs.harvard.edu> To: caml-list@inria.fr Subject: OCaml and tail recursion Cc: nr@labrador.eecs.harvard.edu Sender: weis Dear Camllists, I have just completed my first nontrival Caml program (an implementation of the rsync algorithm) and I am distressed about the treatment of tail calls. My code has to go through files one character at a time, and as an SML programmer from way back, I wrote the code using three mutually recursive functions that make tail calls to each other. Imagine my surprise when I started getting errors with stack overflow! Apparently ocamlc doesn't optimize tail calls. I made some progress by using ocamlopt, but I miss being able to use the debugger. Do experienced Camllists have any suggestions? Norman