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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 412397F7C2 for ; Tue, 4 Feb 2014 20:29:14 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of markus.mottl@gmail.com) identity=pra; client-ip=209.85.216.177; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="markus.mottl@gmail.com"; x-sender="markus.mottl@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of markus.mottl@gmail.com designates 209.85.216.177 as permitted sender) identity=mailfrom; client-ip=209.85.216.177; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="markus.mottl@gmail.com"; x-sender="markus.mottl@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qc0-f177.google.com) identity=helo; client-ip=209.85.216.177; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="markus.mottl@gmail.com"; x-sender="postmaster@mail-qc0-f177.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjYDAPw+8VLRVdixlGdsb2JhbABZg0RLDKpSk0iBBggWDgEBAQEHCwsJEiqCJQEBBUABFAcSCwEDDAYFCw0NISEBAREBBQEKEgYTEodeAQMRDaBDjF2DCZNtChknAwpkiCoRAQUMjFSCFQeEOASJSYx2gWyBMossg1YYKYR3Hg X-IPAS-Result: AjYDAPw+8VLRVdixlGdsb2JhbABZg0RLDKpSk0iBBggWDgEBAQEHCwsJEiqCJQEBBUABFAcSCwEDDAYFCw0NISEBAREBBQEKEgYTEodeAQMRDaBDjF2DCZNtChknAwpkiCoRAQUMjFSCFQeEOASJSYx2gWyBMossg1YYKYR3Hg X-IronPort-AV: E=Sophos;i="4.95,781,1384297200"; d="scan'208";a="47800434" Received: from mail-qc0-f177.google.com ([209.85.216.177]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 04 Feb 2014 20:29:13 +0100 Received: by mail-qc0-f177.google.com with SMTP id i8so14205679qcq.8 for ; Tue, 04 Feb 2014 11:29:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=TFlnE9pMP1/PXCdubP5nfORnFmc3FgI/LQNYKlExABo=; b=TSO8cqvBbWkFvGqz2pJvfTanQdEgutEtFhBHgvWmBdGWqaCOgkNvCk1rQC4oBEti/p lzOK8WFzvoLLr9hKT6tdcTPm9pgH2bcy4UFfNvGRzWRH5BNw/EmeVWH4L5BGnncsnos/ DaiISXDMtOkr+wqwTH8/SJxtQ4iEh1KJyeOC0zfVnAQDI2Q9NiG4vlZ5YWpM00QXwuKo jvX4/NJjfJCiWSjSgq/FOquK3yv0HdLDSCwbgEQeLVGEOSEUATxSrpKy8vOf0vs3mANx LIy9zdjg0qpNfMuT7ljIJntzfS8QrVO6JVYRWOtK7ktuo37TzO16BcHuw6SiUhlx56cV jIbA== MIME-Version: 1.0 X-Received: by 10.224.115.78 with SMTP id h14mr70037616qaq.94.1391542152510; Tue, 04 Feb 2014 11:29:12 -0800 (PST) Received: by 10.140.90.70 with HTTP; Tue, 4 Feb 2014 11:29:12 -0800 (PST) In-Reply-To: References: Date: Tue, 4 Feb 2014 14:29:12 -0500 Message-ID: From: Markus Mottl To: Jeremy Yallop Cc: Caml List Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Proposal: extend try to handle success Btw., I also agree with the postscript on the symmetric extension to "match". I think it would improve code clarity if developers could use "try" to indicate that they expect an exception as a means of control flow, whereas "exception"-branches in "match" clauses would be more suitable for truly exceptional (as in "error") conditions. On Tue, Feb 4, 2014 at 2:18 PM, Markus Mottl wrote: > Nice! I've always hated the "option"-workaround required to maintain > tail-recursion with exception handlers. The required syntax change > seems quite benign, too, and the feature might improve performance a > bit, assuming the code generator has a special case for it rather than > internally rewriting the code to use the "option"-workaround. Doesn't > sound difficult to do either. > > Regards, > Markus > > On Tue, Feb 4, 2014 at 12:00 PM, Jeremy Yallop wrote: >> The recent thread about the representation of options highlighted a >> shortcoming in the "try" construct: there isn't a convenient way to >> express code that should run when the body of the "try" doesn't raise >> an exception. >> >> I'd like to propose extending OCaml with a design once suggested by >> Christophe Raffalli which elegantly handles this case. The details, >> along with an implementation that you can try out, are in the >> following blog post: >> >> http://ocamllabs.github.io/compiler-hacking/2014/02/04/handler-case.html >> >> Feedback welcome! >> >> Jeremy >> >> -- >> 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 > > > > -- > Markus Mottl http://www.ocaml.info markus.mottl@gmail.com -- Markus Mottl http://www.ocaml.info markus.mottl@gmail.com