From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA31304; Wed, 15 Sep 2004 16:17:50 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 QAA31774 for ; Wed, 15 Sep 2004 16:17:49 +0200 (MET DST) Received: from ptb-relay02.plus.net (ptb-relay02.plus.net [212.159.14.213]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i8FEHcsW002362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 15 Sep 2004 16:17:39 +0200 Received: from [80.229.56.224] (helo=chetara) by ptb-relay02.plus.net with esmtp (Exim) id 1C7abF-00041U-AE for caml-list@inria.fr; Wed, 15 Sep 2004 14:17:33 +0000 From: Jon Harrop To: caml-list@inria.fr Subject: Re: [Caml-list] Confused Date: Wed, 15 Sep 2004 15:13:13 +0100 User-Agent: KMail/1.6.2 References: <41472EC6.2080007@gmx.net> <200409151428.54124.jon@jdh30.plus.com> In-Reply-To: <200409151428.54124.jon@jdh30.plus.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200409151513.13792.jon@jdh30.plus.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 stupid:01 outermost:01 rec:01 rec:01 syntax:02 syntax:02 inner:02 wrote:03 let:04 let:04 cheers:06 top-level:07 confused:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wednesday 15 September 2004 14:28, Jon Harrop wrote: > # let rec build = function 0 -> [] | n -> 1e-6 :: build (n-1) in > let test = 1. :: build 1000;; > Syntax error > > Am I being stupid? Yes! The correct syntax is, of course: let test = let rec build = function 0 -> [] | n -> 1e-6 :: build (n-1) in 1. :: build 1000;; So the "let" returned to the top-level has to be the outermost one. All inner "let"s must be followed by "in" and an expression. Thanks, John and Christoph and anyone else who replies before I get this off. ;-) Cheers, Jon. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners