Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Function forward declaration?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: brogoff@s...
Subject: Re: [Caml-list] Function forward declaration?
On Wed, 7 Apr 2004, Marcin 'Qrczak' Kowalczyk wrote:
> W li¶cie z ¶ro, 07-04-2004, godz. 08:01 +0200, Nicolas Cannasse napisa³:
>
> > >   val g : unit -> int
> > >   let f () = g ()
> > >   let x = f ()
> > >   let y = x + 1
> > >   let g () = y
> >
> > What about "compilation error : recursive calls in forward declaration" ?
>
> At which point? What are the correctness criteria in general?
>
> For forward declarations to be useful, they would need to give something
> more than let rec.

Cross module recursion would be enough for me. As a way to provide explicit
typing so that OCaml has good support for polymorphic recursion, would be just
dandy too.

As I'm sure you know, your example fails if translation into let rec form on
account of OCaml's restrictions on allowable recursive values.

BTW, the old mail I mentioned is here

	http://caml.inria.fr/caml-list/1059.html

and the context is polymorphic recursion.

-- Brian

-------------------
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