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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 66CF57F7C2 for ; Wed, 5 Feb 2014 17:04:42 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jesper.louis.andersen@gmail.com) identity=pra; client-ip=209.85.213.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jesper.louis.andersen@gmail.com"; x-sender="jesper.louis.andersen@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of jesper.louis.andersen@gmail.com designates 209.85.213.173 as permitted sender) identity=mailfrom; client-ip=209.85.213.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jesper.louis.andersen@gmail.com"; x-sender="jesper.louis.andersen@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ig0-f173.google.com) identity=helo; client-ip=209.85.213.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jesper.louis.andersen@gmail.com"; x-sender="postmaster@mail-ig0-f173.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AscBAApg8lLRVdWtm2dsb2JhbABZhBuDAbtDgQcIFg4BAQEBAQYLCwkUKIIlAQEEASMEGQEbHQEDAQsGBQQBBgM0AgIiAREBBQEcBhOHcAEDCQiiFYwLU4MJk3YKGScNZIgqEQEFDI5pB4JvgUkEmCuQNBgphFo7 X-IPAS-Result: AscBAApg8lLRVdWtm2dsb2JhbABZhBuDAbtDgQcIFg4BAQEBAQYLCwkUKIIlAQEEASMEGQEbHQEDAQsGBQQBBgM0AgIiAREBBQEcBhOHcAEDCQiiFYwLU4MJk3YKGScNZIgqEQEFDI5pB4JvgUkEmCuQNBgphFo7 X-IronPort-AV: E=Sophos;i="4.95,787,1384297200"; d="scan'208";a="57005211" Received: from mail-ig0-f173.google.com ([209.85.213.173]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 05 Feb 2014 17:04:41 +0100 Received: by mail-ig0-f173.google.com with SMTP id c10so13188334igq.0 for ; Wed, 05 Feb 2014 08:04:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=ESw60pzuln0cvn4FFFZYv4XmmBvN1mzR9fA6L8SjHP4=; b=kcoIYYXt9xzHyQIjXYTfpGpNiLZHud2qhr62aYrBnAI1jmVOQRU/8IxRSDN+UubSPK ye6R0EUTsiQ8J+A5XfxtUoUb7s7lWO2r5ijUvudTD6oQDH73I951U/SOygf0yRtqhBQk WAq6kDTWeuWNq0na34qCZ2PHmzcTkZ4ik2IPQLa9LqY7e1GDI0YYUNku6HPqGItRZA1e MhCcW8wZBcigkZ9W4vJHGNsZ7Cz+Iz9LO+m0P/x+L0NI3wzY8K8g+pQfBpf6fLvYeHd7 Jx6Y5uncsfsTBek7Vf6wYOYYJ6BJih9ZBFFj2voQrufpIiWenDjrkfZZg+W62H582HtW rIVA== X-Received: by 10.42.228.65 with SMTP id jd1mr1425552icb.62.1391616280313; Wed, 05 Feb 2014 08:04:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.43.7.132 with HTTP; Wed, 5 Feb 2014 08:04:25 -0800 (PST) In-Reply-To: References: From: Jesper Louis Andersen Date: Wed, 5 Feb 2014 17:04:25 +0100 Message-ID: To: Yaron Minsky Cc: Markus Mottl , Jeremy Yallop , Caml List Content-Type: multipart/alternative; boundary=001a1132e4cc0d47a204f1aaead1 Subject: Re: [Caml-list] Proposal: extend try to handle success --001a1132e4cc0d47a204f1aaead1 Content-Type: text/plain; charset=UTF-8 On Tue, Feb 4, 2014 at 8:42 PM, Yaron Minsky wrote: > I very much agree! I find the symmetry between try and match to be > quite elegant. Overall, this seems like a great proposal. > Erlang has had a construction like this for some years now. try Expr of Pat1 -> Clause1; Par2 -> Clause2; ... catch Class:Error -> ... end Of notable semantics, the exception only reaches over the scope of Expr and not over ClauseN. In practice, I have used it quite often in Erlang-code. -- J. --001a1132e4cc0d47a204f1aaead1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On Tue, Feb 4, 2014 at 8:42 PM, Yaron Minsky <yminsky@janestreet.com= > wrote:
I= very much agree! =C2=A0I find the symmetry between try and match to be
quite elegant. =C2=A0Overall, this seems like a great proposal.

Erlang has had a construction like this for some years now= .

try = Expr of
=C2=A0 Pat1 -> Clause1;
=C2=A0 Par2 -> Clause2;
=C2= =A0 ...
catch
=C2=A0 Class:Error ->
=C2=A0 =C2=A0 ...
end

= Of notable semantics, the exception only reaches over the scope of Expr and= not over ClauseN. In practice, I have used it quite often in Erlang-code.<= br>

--
J.
--001a1132e4cc0d47a204f1aaead1--