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 VAA07052; Wed, 15 Jan 2003 21:02:54 +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 VAA06781 for ; Wed, 15 Jan 2003 21:02:53 +0100 (MET) Received: from viola.sinor.ru (viola.sinor.ru [217.70.106.9]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h0FK2qr19522 for ; Wed, 15 Jan 2003 21:02:52 +0100 (MET) Received: from sibnet.ru (tlg5-ppp51.sibnet.ru [217.70.116.51]) by viola.sinor.ru (8.12.3/8.12.3) with ESMTP id h0FK2ldA021463 for ; Thu, 16 Jan 2003 02:02:48 +0600 Received: by sibnet.ru id m18YtbZ-001EnvC; Thu, 16 Jan 2003 01:53:41 +0600 (NOVT) Date: Thu, 16 Jan 2003 01:53:41 +0600 From: Max Kirillov To: caml-list@inria.fr Subject: Re: [Caml-list] let rec Message-ID: <20030116015340.B653@max.home> Mail-Followup-To: caml-list@inria.fr References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from vsl@ontil.ihep.su on Wed, Jan 15, 2003 at 10:15:48PM +0300 X-Sender: Max Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Jan 15, 2003 at 10:15:48PM +0300, Vitaly Lugovsky wrote: VL> It's not so funny. Why I can't write it using let rec: VL> VL> let rec f (il,al,ht) = VL> let il2 = Array.make (n2+1) Lnil in VL> acopy il il2; VL> Array.iteri (fun i x -> il2.(all.(i)) <- x) al; VL> xprs (il2,anul,ht) VL> and xprs = VL> (Hashtbl.replace ht name (CTfun(f)); VL> compile_exprs env2 exprs) in VL> f You may use lazy things: > 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; > (Lazy.force xprs) (il2,anul,ht) > and xprs = > lazy ((Hashtbl.replace ht name (CTfun(f)); > compile_exprs env2 exprs)) in > (*optional*) ignore(Lazy.force xprs); > f -- Max ------------------- 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