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 EAA00508; Fri, 5 Mar 2004 04:25:51 +0100 (MET) 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 EAA00480 for ; Fri, 5 Mar 2004 04:25:48 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from web41206.mail.yahoo.com (web41206.mail.yahoo.com [66.218.93.39]) by concorde.inria.fr (8.12.10/8.12.10) with SMTP id i253PkUM030329 for ; Fri, 5 Mar 2004 04:25:47 +0100 Message-ID: <20040305032546.43655.qmail@web41206.mail.yahoo.com> Received: from [67.241.218.215] by web41206.mail.yahoo.com via HTTP; Thu, 04 Mar 2004 19:25:46 PST Date: Thu, 4 Mar 2004 19:25:46 -0800 (PST) From: Vasili Galchin Subject: [Caml-list] Test case syntax error To: caml-list@inria.fr Cc: vasiliocaml@yahoo.com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; run-time:01 trimming:01 ocamlc:01 verbose:01 multicast:01 multicast:01 sock:01 sockaddr:01 sock:01 sockaddr:01 tbd:99 buffer:01 recvfrom:01 buffer:01 printf:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Keywords: X-UID: 49 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) = let descr = Unix.socket Unix.PF_INET Unix.SOCK_DGRAM 0 in try (* Convert IP octet strings to IP addrs *) let my_addr = Unix.inet_addr_of_string my_addr_octet and multicast_addr = Unix.inet_addr_of_string multicast_addr_octet in (* Open a UDP socket *) let sockaddr = Unix.ADDR_INET(my_addr, multicast_port) in (* Bind the sock addr *) Unix.bind descr sockaddr; (* Set TTL for ipv4 *) (* TBD!!! *) (* Join the multicast group *) Unix.multicast_join descr my_addr multicast_addr; (* Read loop *) while true do let (buffer:string) = "" in (* Do blocking read! *) let (x, y) = Unix.recvfrom descr buffer 0 128 [MSG_OOB] done with _ -> Printf.printf "%s\n" "blah";; *) listen ("127.0.0.1", "225.0.0.37", 12345);; __________________________________ Do you Yahoo!? Yahoo! Search - Find what you’re looking for faster http://search.yahoo.com ------------------- 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