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: Marcin 'Qrczak' Kowalczyk <qrczak@k...>
Subject: Re: [Caml-list] Function forward declaration?
W li¶cie z wto, 06-04-2004, godz. 18:53 +0100, Richard Jones napisa³:

> val g : unit -> int		(* prototype; val is already reserved word *)
> 
> let f () = (* ... *) g ()
> 
> (* some intervening code which makes it difficult to use let rec ... and *)
> 
> let g () = (* ... *) 42		(* compiler checks that g matches proto *)

What would this code do?

   val g : unit -> int
   let f () = g ()
   let x = f ()
   let y = x + 1
   let g () = y

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


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