From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id AAA20209; Thu, 5 Apr 2001 00:09:47 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA20208 for ; Thu, 5 Apr 2001 00:09:46 +0200 (MET DST) Received: from smtp4-cm.mail.eni.net (smtp4-cm.mail.eni.net [216.133.226.137]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f34M9ir01314 for ; Thu, 5 Apr 2001 00:09:44 +0200 (MET DST) Received: from checkerlap.d6.com (node-d8e9cca2.powerinter.net [216.233.204.162]) by smtp4-cm.mail.eni.net (8.9.3/8.9.3) with ESMTP id PAA06616 for ; Wed, 4 Apr 2001 15:09:43 -0700 Message-Id: <4.3.2.7.2.20010404142255.0338a1c0@shell16.ba.best.com> X-Sender: def6@shell16.ba.best.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Wed, 04 Apr 2001 14:33:03 -0700 To: caml-list@inria.fr From: Chris Hecker Subject: [Caml-list] semi-colons and begin Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 = () # if false then print_int 2; print_int 3 else ();; Characters 39-43: Syntax error # # if false then begin print_int 2; print_int 3 end;; - : unit = () # if false then begin print_int 2; print_int 3 end else ();; - : unit = () The "BNF" grammar implies the first and second tests should compile and print nothing, since expr = expr ; expr, although Xavier et al. have said the BNF in the docs isn't really accurate. I also thought begin...end was needed in a pattern-match, but apparently expr ; expr works there? Is there a chart or something that says exactly where they're allowed? I'm afraid of introducing a subtle bug in my program. In C I always use brackets with my if statements to avoid the similar problem, so I suppose I could use begin..end everywhere, but yuck! Chris ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr