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 9BAAD7F7C2 for ; Tue, 4 Feb 2014 20:43:02 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of yminsky@janestreet.com) identity=pra; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of yminsky@janestreet.com designates 38.105.200.229 as permitted sender) identity=mailfrom; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.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@tot-dmz-mxout1.janestreet.com) identity=helo; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@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: AvwBAIZC8VImacjlnGdsb2JhbABZg0RXqlKTSIEHHg4BAQEBAQYWCTyCJQEBBAFAAQETGQsBBAsLCw0NISEBEgEFAQoSBhMSh18DCQgDAgigTosUhFIBBZQ0AwqJDhEGjGCCFQeEOIlNjHaBbIEyiyyDVhgphHc X-IPAS-Result: AvwBAIZC8VImacjlnGdsb2JhbABZg0RXqlKTSIEHHg4BAQEBAQYWCTyCJQEBBAFAAQETGQsBBAsLCw0NISEBEgEFAQoSBhMSh18DCQgDAgigTosUhFIBBZQ0AwqJDhEGjGCCFQeEOIlNjHaBbIEyiyyDVhgphHc X-IronPort-AV: E=Sophos;i="4.95,781,1384297200"; d="scan'208";a="47801481" Received: from mx5.janestreet.com (HELO tot-dmz-mxout1.janestreet.com) ([38.105.200.229]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 04 Feb 2014 20:43:01 +0100 Received: from tot-oib-smtp1.delacy.com ([172.27.22.15] helo=tot-smtp) by tot-dmz-mxout1.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1WAlta-0005Zv-CC for caml-list@inria.fr; Tue, 04 Feb 2014 14:42:58 -0500 Received: from tot-dmz-mxgoog1.delacy.com ([172.27.224.14] helo=mxgoog2.janestreet.com) by tot-smtp with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WAlta-0001tJ-An for caml-list@inria.fr; Tue, 04 Feb 2014 14:42:58 -0500 Received: from mail-lb0-f181.google.com ([209.85.217.181]) by mxgoog2.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1WAlta-00048b-4M for caml-list@inria.fr; Tue, 04 Feb 2014 14:42:58 -0500 Received: by mail-lb0-f181.google.com with SMTP id z5so6716451lbh.40 for ; Tue, 04 Feb 2014 11:42:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=wFhZeFAJ6o+QIsmtGHZU2N9dRNzNj2FUvk5nk4/xduc=; b=c7ZTuUQ57wQq9XICC+wuKMhxT6m+2FyF8iGWNjohgGJgYf5UEJPUF96VSgX6EzeQCw Y2lBZNdaxQBCsNBVLnW8OlHozywIZLEYzPypd7xQbuAjlCZJf87ZTaEjf68l8w1KNMdO PUDI8tPRQsuqUltDi6u87jRDmdCGeBG4ZHF4A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=wFhZeFAJ6o+QIsmtGHZU2N9dRNzNj2FUvk5nk4/xduc=; b=C+HMg7Gwm+jkjn9lbjvkwNic3EfZ1hd55kmwrBlL4/xNuNGPqmh8qzFuLdV8ysBsYS IzuVfkMTzJkceRwMkK79HNAIfevM7voSs7kH98CRtu3cWIwM5gvB2GapMi96doSYVNuL 9ZjkcM50NezpTelBhA6bCo4PyvjfobsPh9hxplfuQt2piTaa7H6SIRSEaXeN0UAE1PmK fv4WsczfhPsLelmDHggyHlfZ+F3KytnnudwDzu7YdwMHSp5m6aalFJnkWTUAAm3RYMee 7mwmkc7mBauvR8Kh3KvcbCzAuum6Gz2Ue49fJTpaHFWNbqtTtV3UXM380DGcGudb0Kx0 iFow== X-Gm-Message-State: ALoCoQmk7T6dCEaUSjoBzX2ZiPGcjoem49wjoPMYGyuKBU8DajjeNL+jZnedCUjM9MRktzkBScbbSOIpgsZYGQOqt5o52PsHQrM1/fETww/HFqzDfcRI1dwds8teYpUwrEL6HmNbMsigvfRthvXm1idIkNk0U8LVjQ== X-Received: by 10.112.142.230 with SMTP id rz6mr23878340lbb.0.1391542977454; Tue, 04 Feb 2014 11:42:57 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.112.142.230 with SMTP id rz6mr23878327lbb.0.1391542977280; Tue, 04 Feb 2014 11:42:57 -0800 (PST) Received: by 10.112.5.68 with HTTP; Tue, 4 Feb 2014 11:42:57 -0800 (PST) In-Reply-To: References: Date: Tue, 4 Feb 2014 14:42:57 -0500 Message-ID: From: Yaron Minsky To: Markus Mottl Cc: Jeremy Yallop , Caml List Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Proposal: extend try to handle success On Tue, Feb 4, 2014 at 2:29 PM, Markus Mottl wrote: > 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. I very much agree! I find the symmetry between try and match to be quite elegant. Overall, this seems like a great proposal. y > 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 > > -- > 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