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 B4CED7EDC2 for ; Thu, 22 Nov 2012 11:37:32 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of dhouse@janestreet.com) identity=pra; client-ip=38.105.200.229; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="dhouse@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of dhouse@janestreet.com designates 38.105.200.229 as permitted sender) identity=mailfrom; client-ip=38.105.200.229; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="dhouse@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@tot-dmz-mxout1.janestreet.com) identity=helo; client-ip=38.105.200.229; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="postmaster@tot-dmz-mxout1.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At8BAKj/rVAmacjlmWdsb2JhbABEr1qSPR4OAQEBAQEICwsHFCeCHgEBBQw0AQEsCwEPCwsNDSEiEgEFAQoSBhMICodpAw8DAQehE4p0hDcBBYVMA4lYBow0hFGWAoEcjUUWKYQQghk X-IronPort-AV: E=Sophos;i="4.83,299,1352070000"; d="scan'208";a="163419333" Received: from mx5.janestreet.com (HELO tot-dmz-mxout1.janestreet.com) ([38.105.200.229]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Nov 2012 11:37:31 +0100 Received: from tot-smtp.delacy.com ([172.27.22.35] helo=tot-is-smtp) by tot-dmz-mxout1.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1TbU9s-0004H3-LY for caml-list@inria.fr; Thu, 22 Nov 2012 05:37:24 -0500 Received: from tot-dmz-mxgoog1.delacy.com ([172.27.224.14] helo=mxgoog2.janestreet.com) by tot-is-smtp with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1TbU9s-0004mw-Kr for caml-list@inria.fr; Thu, 22 Nov 2012 05:37:24 -0500 Received: from mail-wi0-f198.google.com ([209.85.212.198]) by mxgoog2.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1TbU9s-0001OY-H8 for caml-list@inria.fr; Thu, 22 Nov 2012 05:37:24 -0500 Received: by mail-wi0-f198.google.com with SMTP id c10so674938wiw.9 for ; Thu, 22 Nov 2012 02:37:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=jCwm3OK68q8RrLTUzqxyXSZCpBxeHlAGOaoCGk4ihd0=; b=woe5lM9bdOqwTm662oXCnTFKLmjF4gGHpZVdQVUM8brQGiIMa5kGgYSrJhq9/Lr35H YKxyI3aZXnJzpd8Bp8kApQZu8/a+1omJUWunOTFbsKpxlvqD39rcT3IeXOqk1n8w6pin NBV+qZrIKs5gaUO7/13i5xgAFzLv27jTEzbOQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=jCwm3OK68q8RrLTUzqxyXSZCpBxeHlAGOaoCGk4ihd0=; b=DQNL0xAhBSqxHS/r7lV6h7l3k5qPV97DaSNu+X5gXZ6Zk67V/dOJFeG5zAoOeUPcXB sZgdesfCSSGkj0tMFOsyftvUxBo1n9HYHTos54jYLRWceU6oGkLedz+woDHmU5HIyLiO Ms6mjMDCOUo0yQP/OazeZuyZraawJ4AOIv+9imx20lcPYdJk+Tmy3q/rAYFqvL20/BCh EB5+lDiJYyjsk44/1KEMMf/ZKc789ZjgzwZdscyg1duu72EeOhtWu9tlcf+2XhHVLzMH vfk2z9XVz/GKNCewoIB5FTjl2FfknzfOSqz6WdYeDRtoKe0nU17FYtKeediqwiKWwRFS BijA== Received: by 10.204.5.141 with SMTP id 13mr44661bkv.35.1353580643868; Thu, 22 Nov 2012 02:37:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.5.141 with SMTP id 13mr44657bkv.35.1353580643721; Thu, 22 Nov 2012 02:37:23 -0800 (PST) Received: by 10.204.35.77 with HTTP; Thu, 22 Nov 2012 02:37:23 -0800 (PST) X-Originating-IP: [80.169.196.210] In-Reply-To: <50ADFF81.4000300@etorok.net> References: <50ADFF81.4000300@etorok.net> Date: Thu, 22 Nov 2012 10:37:23 +0000 Message-ID: From: David House To: =?ISO-8859-1?Q?T=F6r=F6k_Edwin?= Cc: OCaml Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQk/TfAP4xYI5e9Z05KMuD2XTa7SZsO2U3H2h8M3tQ2k69x8y1cZhboA2dn1uYzdPtJQVEc+Ox2DCLSC2mQZq4e8lPZsvmP7ILNa0pYdxbqt7vNukq/4OGFrp57HsKHw66anmPIg9zF1qCGBYWCn+lPbzVOhfg== Subject: Re: [Caml-list] Lazyness and exceptions In other words: what alternative semantics would you actually want? On Thu, Nov 22, 2012 at 10:33 AM, T=F6r=F6k Edwin wrote: > On 11/22/2012 12:29 PM, Jean-vincent.Loddo@lipn.univ-paris13.fr wrote: >> 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 =3D >> let thunk () =3D >> Printf.printf "aaa\n"; >> failwith "bbb" >> in >> lazy (thunk ());; >> >> val action : unit lazy_t =3D >> >> # 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 exceptio= n is (strangely) raised again. Why does this happen? > > Its the documented behavior: > http://caml.inria.fr/pub/docs/manual-ocaml/libref/Lazy.html > > Unfortunately the original backtrace will be lost. > > --Edwin > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs