From: Vasili Galchin <vasiliocaml@yahoo.com>
To: caml-list@inria.fr
Cc: vasiliocaml@yahoo.com
Subject: [Caml-list] Test case syntax error
Date: Thu, 4 Mar 2004 19:25:46 -0800 (PST) [thread overview]
Message-ID: <20040305032546.43655.qmail@web41206.mail.yahoo.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0403041651030.10492-100000@lcmpc4.epfl.ch>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 2666 bytes --]
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 youre 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
next prev parent reply other threads:[~2004-03-05 3:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-01 14:24 [Caml-list] The Makefile Rakotomandimby Mihamina
2004-03-01 16:04 ` Remi Vanicat
2004-03-01 16:41 ` Rakotomandimby Mihamina
2004-03-02 1:00 ` [Caml-list] use of abstract type "inet_addr" Vasili Galchin
2004-03-02 10:00 ` Olivier Pérès
2004-03-02 15:38 ` Christophe TROESTLER
2004-03-04 2:48 ` SooHyoung Oh
2004-03-04 15:53 ` Henri DF
2004-03-05 3:25 ` Vasili Galchin [this message]
2004-03-05 4:42 ` [Caml-list] Test case syntax error William Lovas
2004-03-05 7:39 ` Shawn Wagner
2004-03-05 8:05 ` sebastien FURIC
2004-03-05 12:44 ` John Carr
2004-03-05 15:13 ` Remi Vanicat
2004-03-05 18:00 ` [Caml-list] use of abstract type "inet_addr" Didier Remy
2004-03-01 16:37 ` [Caml-list] The Makefile Rakotomandimby Mihamina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040305032546.43655.qmail@web41206.mail.yahoo.com \
--to=vasiliocaml@yahoo.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox