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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Michal Moskal <malekith@p...>
Subject: Re: [Caml-list] OCaml wishlist
On Tue, Oct 21, 2003 at 09:52:17PM -0500, Brian Hurt wrote:
> On Wed, 22 Oct 2003, Jacques Garrigue wrote:
> 
> > Of course you have to be careful: you can shoot yourself in the foot
> > with wrong indentation:
> > 
> >   let quit _ =
> >     let icon = GMisc.image () in
> >     if !test_id = 0 then (GMain.Main.quit (); false) else
> >     icon#set_stock `DIALOG_QUESTION;
> >     icon#set_icon_size `DIALOG;
> >     [...]
> > 
> > In this case you're just going to jump over icon#set_stock...
> 
> This is a classic problem with dangling-elses, and you see it in C as 
> well:
> 
>     if (x == 3)
>         y = 7;
>         z = 8;

It's dangling semicolon problem :-) 

	if foo then bar
	else
	  let x = baz in 
	  qux;
	  quxx

is different from:

	let x = baz in 
	if foo then bar
	else
	  qux;
	  quxx

let in the beginning changes meaning of semicolon.

-- 
: Michal Moskal :: http://www.kernel.pl/~malekith : GCS {C,UL}++++$ a? !tv
: When in doubt, use brute force. -- Ken Thompson : {E-,w}-- {b++,e}>+++ h

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