Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] semi-colons and begin
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] semi-colons and begin
Hi,

On Wed, Apr 04, 2001 at 02:33:03PM -0700, Chris Hecker wrote:

> I must admit I'm still slightly confused about the semicolon thing,
> even after writing a fair amount of caml code.  The current sticking
> point is that
> 
> # if false then print_int 2; print_int 3;;
> 3- : unit = ()

Do you want me to confuse you more? Try this:

# if false then let _ = () in print_int 2; print_int 3;;

> # if false then print_int 2; print_int 3 else ();;
> Characters 39-43:
> Syntax error

And this one:
# if false then let _ = () in print_int 2; print_int 3 else print_int 4;;

And this situation:
   if blahblah then
      thing1;
   thing2;
   thing3;
I decide to add a let..in for the thing1.

What you see:
   if blahblah then
      let x = e in
      thing1;
   thing2;
   thing3;
What you get:
   if blahblah then
      let x = e in
      thing1;
      thing2;
      thing3;

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr