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 SAA08071 for caml-redistribution; Tue, 28 Jul 1998 18:36:36 +0200 (MET DST) 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 IAA16001 for ; Tue, 28 Jul 1998 08:15:19 +0200 (MET DST) Received: from fritz.traverse.net (oliverhome.cablezone.com [207.140.231.102]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id IAA21685 for ; Tue, 28 Jul 1998 08:15:16 +0200 (MET DST) Received: from oliver by fritz.traverse.net with local (Exim 1.90 #1) for Pierre.Weis@inria.fr id 0z132Z-000073-00; Tue, 28 Jul 1998 02:15:15 -0400 Subject: Re: Let rec trouble To: Pierre.Weis@inria.fr (Pierre Weis) Date: Tue, 28 Jul 1998 02:15:14 -0400 (EDT) From: "Christopher Oliver" In-Reply-To: <199807280014.CAA01029@pauillac.inria.fr> from "Pierre Weis" at Jul 28, 98 02:14:29 am X-Mailer: ELM [version 2.4 PL25 PGP3 *ALPHA*] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: Sender: weis > > Um... I'm getting "syntax error" with OLABL 1.07. > > Not in O'Caml :) Jacques Garrigue found the problem, and it likely applies to OCAML as well. I didn't terminate my open directives with a semicolon. He say the compiler was expecting a top level definition rather than a lambda binding because of this. This version compiles just fine: open Num open Nat open Big_int open Ratio;; (* Note the trailing statement delimiter. *) let rec n k l = let rec m i = if i =/ Int 0 then Int 1 else Int 2 */ (m (pred_num i)) */ (n (k **/ (m (pred_num i))) (pred_num l)) in if l =/ Int 2 then succ_num k else m k in print_string (string_of_num (n (Int 3) (Int 3)));; Given that some of the system sources conspicuously omit the double semicolons, maybe it would be good to document where this is permitted and why, else people studying the compiler as example code will get very confused. Small question: is there any chance your CAML books will be available in an English translation in the future? While I can work my way through something like "Miroir du Cyclism" with difficulty, my French is hardly up to technical reading. Also, I'd like something I can recommend to colleagues who may have no exposure to French whatsoever. Thank you, -- Christopher Oliver Traverse Internet Systems Coordinator 223 Grandview Pkwy, Suite 108 oliver@traverse.net Traverse City, Michigan, 49684 let magic f = fun x -> x and more_magic n f = fun x -> f ((n f) x);;