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 E4D687EE4B for ; Thu, 10 Oct 2013 21:34:41 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of agarwal1975@gmail.com) identity=pra; client-ip=209.85.223.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of agarwal1975@gmail.com designates 209.85.223.171 as permitted sender) identity=mailfrom; client-ip=209.85.223.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@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-ie0-f171.google.com) identity=helo; client-ip=209.85.223.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="postmaster@mail-ie0-f171.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArkCALwAV1LRVd+rlGdsb2JhbABZhBHBLoEdCBYOAQEBAQcLCwkSKoIcCQEBBAEnGQEbHQEDAQsGBQMBBzshAQERAQUBHAYTh3MBAwkGnAyMVYMKhBUKGScNZIkBAQUMjE6CbQeEIwOWHIFpjEyDSxgphGog X-IPAS-Result: ArkCALwAV1LRVd+rlGdsb2JhbABZhBHBLoEdCBYOAQEBAQcLCwkSKoIcCQEBBAEnGQEbHQEDAQsGBQMBBzshAQERAQUBHAYTh3MBAwkGnAyMVYMKhBUKGScNZIkBAQUMjE6CbQeEIwOWHIFpjEyDSxgphGog X-IronPort-AV: E=Sophos;i="4.90,1074,1371074400"; d="scan'208";a="29865503" Received: from mail-ie0-f171.google.com ([209.85.223.171]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 Oct 2013 21:34:41 +0200 Received: by mail-ie0-f171.google.com with SMTP id at1so6131402iec.16 for ; Thu, 10 Oct 2013 12:34:39 -0700 (PDT) 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=B1isx+Vffhh9v76yb82+H5Qkdu52hOv1sIfwhs+c6vM=; b=s6z50ZeCVBKUqfh0GXEIu/nAIhySvFeeTH4w27E41RnF6XlkCyEooYK/DkqruaXHEK Chiu2Sbu3QPEA050q7rFstlbFzAb8PNMkFKPbrskTbxxb4SLJRX+c1Uk3jgGho0MYa+H rucxmsFoVcWXThe6I/QI6AP0MaPhMmjcYoECt6h2h7H9U+C3Mv6gU7cvwGCOulCOKCIn 8LFKdVBM3UapiQ3y81VWv/YpZms3MsY0tGw8EKsSmZR7zr31GjzpqyDfsRqhyBeiQI0U +T91qnWsPPdFj7qyO1S0wss6ve7KTJ+esfwDsRo9G8d1haYjXKY60M+4Iw6jxSUS176K uZOA== X-Received: by 10.50.119.4 with SMTP id kq4mr7929159igb.40.1381433679682; Thu, 10 Oct 2013 12:34:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.251.36 with HTTP; Thu, 10 Oct 2013 12:34:19 -0700 (PDT) In-Reply-To: References: From: Ashish Agarwal Date: Thu, 10 Oct 2013 15:34:19 -0400 Message-ID: To: Yotam Barnoy Cc: Ocaml Mailing List Content-Type: multipart/alternative; boundary=089e013c6e4ac2244504e86817fb Subject: Re: [Caml-list] Pattern matching on refs --089e013c6e4ac2244504e86817fb Content-Type: text/plain; charset=ISO-8859-1 Would it solve your problem to instead write: match !x with | y -> ... On Thu, Oct 10, 2013 at 3:17 PM, Yotam Barnoy wrote: > I recently found out how ugly it is to pattern-match on a ref, using > {contents=...}. This should be extremely easy to fix in the parser. Can it > please be put into the next version of ocaml? > ie. > > match x with > | ref y -> ... > > -Yotam > --089e013c6e4ac2244504e86817fb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Would it solve your problem to instead write:

match !x with
| y -> ...


On Thu, Oct 10, 2013 at 3:17 PM,= Yotam Barnoy <yotambarnoy@gmail.com> wrote:
I recen= tly found out how ugly it is to pattern-match on a ref, using {contents=3D.= ..}. This should be extremely easy to fix in the parser. Can it please be p= ut into the next version of ocaml?
ie.

match x with
| ref y -> ...

-Yotam

--089e013c6e4ac2244504e86817fb--