From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 9308EBBAF for ; Tue, 3 Nov 2009 08:46:49 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAP9u70peFxRU/2dsb2JhbACEdMdPkDCBMoI4UwSBZA X-IronPort-AV: E=Sophos;i="4.44,673,1249250400"; d="scan'208";a="36059832" Received: from glyptal.glondu.net ([94.23.20.84]) by mail2-smtp-roc.national.inria.fr with ESMTP; 03 Nov 2009 08:46:49 +0100 Received: from [10.198.42.2] (unknown [10.198.42.2]) by glyptal.glondu.net (Postfix) with ESMTP id 5D46959D8A; Tue, 3 Nov 2009 08:46:46 +0100 (CET) Message-ID: <4AEFDFE5.2030004@glondu.net> Date: Tue, 03 Nov 2009 08:46:45 +0100 From: =?UTF-8?B?U3TDqXBoYW5lIEdsb25kdQ==?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: Tim Hanson Cc: caml-list@inria.fr Subject: Re: [Caml-list] Lwt try_bind question... References: <9d2084740911022107g3ea468c3xa5b34a38258dfd40@mail.gmail.com> In-Reply-To: <9d2084740911022107g3ea468c3xa5b34a38258dfd40@mail.gmail.com> X-Enigmail-Version: 0.95.0 OpenPGP: id=49881AD3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; ocamlfind:01 ocamlc:01 -package:01 syntax:01 camlp:01 ocamlfind:01 ocamlc:01 -package:01 syntax:01 camlp:01 buffer:01 ocaml:01 cheers:01 phane:98 steph:98 Tim Hanson a =C3=A9crit : > I've been trying to use Lwt in my application (robot control). [...] Hummm... How familiar :-) > I compile with the following line: > ocamlfind ocamlc -c -package lwt,lwt.unix,lwt.syntax -syntax camlp4o re= lay.ml Try instead: ocamlfind ocamlc -c -package lwt,lwt.unix,lwt.syntax -syntax camlp4o -syntax lwt.syntax toto.ml Or just: ocamlfind ocamlc -c -package lwt,lwt.unix toto.ml If you don't use Lwt's syntax extensions. But there is a type error in your code: > try_bind > (fun () -> (Lwt_unix.read banger_socket buffer 0 512)) > (fun n -> read_banger n ) > (fun _ -> (Lwt_unix.sleep 3.0) >>=3D read_banger 0 ) It should be ">>=3D fun () -> read_banger 0" (in plain OCaml), or ">> read_banger 0" (with the camlp4 extension). Cheers, --=20 St=C3=A9phane