Browse thread
[Caml-list] let rec
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2003-01-16 (14:22) |
From: | Mike Potanin <potanin@m...> |
Subject: | Re: [Caml-list] let rec |
On Wed, 15 Jan 2003, Vitaly Lugovsky wrote: > It's not so funny. Why I can't write it using let rec: > > 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 > > Sure, let rec construction should be much less restrictive. The similar problem arises in a case let ring l = let rec r = l@r in r OCaml type system can not understand that the design is safe. > > And, another one question: does ocaml compiler really eliminates > unused variables from the closure environment? > > ------------------- > 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 > ------------------- 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