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 IAA10369; Fri, 5 Mar 2004 08:41:10 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA10421 for ; Fri, 5 Mar 2004 08:41:09 +0100 (MET) Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i257fJIq023271 for ; Fri, 5 Mar 2004 08:41:20 +0100 Received: (qmail 7388 invoked by uid 64014); 5 Mar 2004 07:41:06 -0000 Received: from shawnw@speakeasy.org by mail6.speakeasy.net with AmikaGuardian-Server-2.1.2; 05 Mar 2004 07:41:06 -0000 X-AmikaGuardian-Id: mail6.speakeasy.net10784724652617379 X-AmikaGuardian-Category: AN:Override Structure : 3.25 X-AmikaGuardian-Category: AN:Vectored : 3.25 X-AmikaGuardian-Category: AN:Forwarded Mail : 3.25 X-AmikaGuardian-Category: AN:Override : 3.25 X-AmikaGuardian-Category: AN:Exception : 3.25 X-AmikaGuardian-Action: Do Nothing() Received: from dialup-67.75.200.13.dial1.seattle.level3.net (HELO sherlock.localdomain) (shawnw@[67.75.200.13]) (envelope-sender ) by mail6.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 5 Mar 2004 07:41:05 -0000 Received: by sherlock.localdomain (Postfix, from userid 502) id 11F0811396; Thu, 4 Mar 2004 23:39:48 -0800 (PST) Date: Thu, 4 Mar 2004 23:39:48 -0800 From: Shawn Wagner To: caml-list@inria.fr Subject: Re: [Caml-list] Test case syntax error Message-ID: <20040305073948.GI27866@speakeasy.org> Mail-Followup-To: caml-list@inria.fr References: <20040305032546.43655.qmail@web41206.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040305032546.43655.qmail@web41206.mail.yahoo.com> User-Agent: Mutt/1.4.2i X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; shawnw:01 caml-list:01 2004:99 run-time:01 trimming:01 ocamlc:01 verbose:01 multicast:01 multicast:01 buffer:01 recvfrom:01 buffer:01 printf:01 printf:01 shawnw:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Keywords: X-UID: 51 On Thu, Mar 04, 2004 at 07:25:46PM -0800, Vasili Galchin wrote: > Hello, > > I have added some functionality to the OCaml > run-time library and I am trying to test. I wrote test > case below that refuses to complile. > > 1) It gets a syntax error on the ending "done" for the > "while true". I have tried trimming down and still the > syntax error. I am sorry for something so elementary. > Can anyone help? > > 2) I am running on Linux. I did a "man ocamlc" to see > what kind of compiler switches there are. Is there a > compiler switch that gives a more verbose/helpful > error than simply "syntax error"? > > Regards, vasili > > ----------------------------test case----------------- > > (* The multicast listener *) > let listen ((my_addr_octet:string), > (multicast_addr_octet:string), multicast_port) = You don't have to specify types like this. Let the compiler figure it out instead. :) It's also an odd style to take all the arguments in one tuple, instead of making them curry-able: let listen my_addr_octect multicast_addr_octet multicast_port = ... > > (* Read loop *) > while true do > > > let (buffer:string) = "" in > (* Do blocking read! *) > let (x, y) = Unix.recvfrom descr > buffer 0 128 [MSG_OOB] You need an 'in' after the let binding, and code following that. > done > with > _ -> Printf.printf "%s\n" "blah";; -- Shawn Wagner shawnw@speakeasy.org ------------------- 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