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 UAA05804; Wed, 15 Jan 2003 20:27:40 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA05650 for ; Wed, 15 Jan 2003 20:27:39 +0100 (MET) Received: from wetware.wetware.com (wetware.wetware.com [199.108.16.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h0FJRcr18252 for ; Wed, 15 Jan 2003 20:27:38 +0100 (MET) Received: from wetware.com(ra09.wetware.com[199.108.16.89]) (1586 bytes) by wetware.wetware.com via sendmail with P:esmtp/R:bind_hosts/T:inet_zone_bind_smtp (sender: ) id for ; Wed, 15 Jan 2003 11:27:37 -0800 (PST) (Smail-3.2.0.114 2001-Aug-6 #1 built 2002-Sep-2) Date: Wed, 15 Jan 2003 11:27:38 -0800 Subject: Re: [Caml-list] let rec Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) Cc: The Trade To: Vitaly Lugovsky From: james woodyatt In-Reply-To: Message-Id: <687F778F-28BF-11D7-9380-000393BA7EBA@wetware.com> Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.551) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wednesday, Jan 15, 2003, at 11:15 US/Pacific, Vitaly Lugovsky wrote: > > let rec f (il,al,ht) = > let il2 = Array.make (n2+1) Lnil in > acopy il il2; > Array.iteri (fun i x -> il2.(all.(i)) <- x) al; > xprs (il2,anul,ht) > and xprs = > (Hashtbl.replace ht name (CTfun(f)); > compile_exprs env2 exprs) in > f I run into the same sort of problem all the time. It's that 'let rec' requires the patten on the left to be a function (okay, there's a weird exception, but you don't care about it). Try this: let rec f (il,al,ht) = let il2 = Array.make (n2+1) Lnil in acopy il il2; Array.iteri (fun i x -> il2.(all.(i)) <- x) al; xprs (il2,anul,ht) and xprs x = (Hashtbl.replace ht name (CTfun(f)); compile_exprs env2 exprs) x in f -- j h woodyatt that's my village calling... no doubt, they want their idiot back. ------------------- 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