Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] strange behaviour of ocamldoc
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@j...>
Subject: Re: [Caml-list] Confused
On Wednesday 15 September 2004 14:28, Jon Harrop wrote:
> # let rec build = function 0 -> [] | n -> 1e-6 :: build (n-1) in
>   let test = 1. :: build 1000;;
> Syntax error
>
> Am I being stupid?

Yes! The correct syntax is, of course:

let test =
  let rec build = function 0 -> [] | n -> 1e-6 :: build (n-1) in
  1. :: build 1000;;

So the "let" returned to the top-level has to be the outermost one. All inner 
"let"s must be followed by "in" and an expression.

Thanks, John and Christoph and anyone else who replies before I get this 
off. ;-)

Cheers,
Jon.

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