caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Raphaël Proust" <raphlalou@gmail.com>
To: Jacques-Pascal Deplaix <jp.deplaix@gmail.com>
Cc: OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] lwt exceptions and infinite loops
Date: Tue, 19 Nov 2013 11:11:20 +0000	[thread overview]
Message-ID: <CAAmHUAkzcSk6p5w6oL=V4USZ8KNfF+z01tjKLiTzbjX41b2evQ@mail.gmail.com> (raw)
In-Reply-To: <528B463A.5080303@gmail.com>

On Tue, Nov 19, 2013 at 11:06 AM, Jacques-Pascal Deplaix
<jp.deplaix@gmail.com> wrote:
> Where did you find the operator (>>) ? Your function loop doesn't
> terminate because (>>) evaluates both arguments.

Lwt's syntax extensions provides (>>) as sugar for `>>= fun () ->`.

http://ocsigen.org/lwt/api/Pa_lwt


>
> On 11/19/2013 05:48 AM, Ivan Gotovchits wrote:
>> consider the following simple example:
>>
>>   open Lwt
>>   let rec loop () = Lwt_unix.sleep 1. >> loop ()
>>   let bad () = Lwt_unix.sleep 1. >> fail Not_found
>>   let () = Lwt_main.run (join [loop (); bad ()])
>>
>>
>> This program never terminates with an exception as I expect.
>>
>> Can someone clarify to me what really happens underneath the hood?
>>
>> Thanks in advance!
>>



-- 
______________
Raphaël Proust

  reply	other threads:[~2013-11-19 11:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19  4:48 Ivan Gotovchits
2013-11-19  9:21 ` Jeremie Dimino
2013-11-19 12:32   ` Ivan Gotovchits
2013-11-19 11:06 ` Jacques-Pascal Deplaix
2013-11-19 11:11   ` Raphaël Proust [this message]
2013-11-19 11:35     ` Jacques-Pascal Deplaix

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='CAAmHUAkzcSk6p5w6oL=V4USZ8KNfF+z01tjKLiTzbjX41b2evQ@mail.gmail.com' \
    --to=raphlalou@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=jp.deplaix@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).