From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 7FF0B7EDC2 for ; Thu, 22 Nov 2012 11:29:09 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of Jean-vincent.Loddo@lipn.univ-paris13.fr) identity=pra; client-ip=194.254.163.15; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="Jean-vincent.Loddo@lipn.univ-paris13.fr"; x-sender="Jean-vincent.Loddo@lipn.univ-paris13.fr"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of Jean-vincent.Loddo@lipn.univ-paris13.fr) identity=mailfrom; client-ip=194.254.163.15; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="Jean-vincent.Loddo@lipn.univ-paris13.fr"; x-sender="Jean-vincent.Loddo@lipn.univ-paris13.fr"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail.lipn.univ-paris13.fr) identity=helo; client-ip=194.254.163.15; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="Jean-vincent.Loddo@lipn.univ-paris13.fr"; x-sender="postmaster@mail.lipn.univ-paris13.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au4CAFn9rVDC/qMPgWdsb2JhbABEhiG8FA4BARYmJ4JIFVUhAiYCXxuICZ4pjlCSeYEijDyCFIETA5V/kzE X-IronPort-AV: E=Sophos;i="4.83,299,1352070000"; d="scan'208";a="163417980" Received: from gw.lipn.univ-paris13.fr (HELO mail.lipn.univ-paris13.fr) ([194.254.163.15]) by mail4-smtp-sop.national.inria.fr with ESMTP; 22 Nov 2012 11:29:08 +0100 Received: from webmail.lipn.univ-paris13.fr (lipn-webmail [10.10.0.93]) by mail.lipn.univ-paris13.fr (Postfix) with ESMTP id 676F7C003 for ; Thu, 22 Nov 2012 11:29:08 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 22 Nov 2012 11:29:08 +0100 From: Jean-vincent.Loddo@lipn.univ-paris13.fr To: Message-ID: X-Sender: loddo@lipn.univ-paris13.fr User-Agent: Roundcube Webmail/0.5.2 X-Validation-by: jean-vincent.loddo@lipn.univ-paris13.fr Subject: [Caml-list] Lazyness and exceptions Hello, I have observed a strange behaviour of lazy values when an exception is raised. Here a minimal code that reproduces the behaviour: # let action = let thunk () = Printf.printf "aaa\n"; failwith "bbb" in lazy (thunk ());; val action : unit lazy_t = # Lazy.force action ;; aaa Exception: Failure "bbb". # Lazy.force action ;; Exception: Failure "bbb". The lazy value seems to be (correctly) not re-evaluated but the exception is (strangely) raised again. Why does this happen? Jean-Vincent Loddo