Version française
Home     About     Download     Resources     Contact us    
Browse thread
If OCaml were a car
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: tab@s...
Subject: Re: [Caml-list] If OCaml were a car
On Sun, Aug 19, 2007 at 06:07:16PM +0100, Richard Jones wrote:
> > Unfortunately, I didn't think to start cataloging compiler error
> > messages and their causes when I started learning the language.
> > I did send one anomaly to the list about parsing of semicolons.
> 
> I tell beginners that most code they write should be within a toplevel
> statement:
> 
>   let _ =
>     ...

That's very bad to advocate this kind of construct.
on weird function, you are going to get caugth with partial application
and ocaml will never tell you.

for example:

let _ = Printf.printf "something %s" in

will never print ... and it will takes some time to a beginners to find
what's going on.

> or (better):
> 
>   let () =
>     ...

at least this one prevent you for doing so..

-- 
Vincent Hanquez