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 25AA980211 for ; Thu, 19 Oct 2017 16:29:12 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=vrotaru.md@gmail.com; spf=Pass smtp.mailfrom=vrotaru.md@gmail.com; spf=None smtp.helo=postmaster@mail-lf0-f41.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of vrotaru.md@gmail.com) identity=pra; client-ip=209.85.215.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="vrotaru.md@gmail.com"; x-sender="vrotaru.md@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of vrotaru.md@gmail.com designates 209.85.215.41 as permitted sender) identity=mailfrom; client-ip=209.85.215.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="vrotaru.md@gmail.com"; x-sender="vrotaru.md@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-lf0-f41.google.com) identity=helo; client-ip=209.85.215.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="vrotaru.md@gmail.com"; x-sender="postmaster@mail-lf0-f41.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3Alv+flRHYFgoR7xm1p6OCXZ1GYnF86YWxBRYc798d?= =?us-ascii?q?s5kLTJ76r8+wAkXT6L1XgUPTWs2DsrQf1LqQ7viocFdDyKjCmUhKSIZLWR4BhJ?= =?us-ascii?q?detC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TXhpQIVTzD2KQd3?= =?us-ascii?q?bsfy6AvRx5Cy3uG205jafwhKwTm6erJxahO7sVOCmNMRhN4oNLw21hLTvz1Nd8?= =?us-ascii?q?xZwGppIRSYmBO2rpOu5pl/+j5N/fct38FFWKT+Oa8/SOoLX3wdL2kp6Ziz5lH4?= =?us-ascii?q?RgyV6y5EXw=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AcAQDptehZhinXVdFdHAEBBAEBCgEBF?= =?us-ascii?q?wEBBAEBCgEBhBhuJ4N6gTaYIoF6kHSFP4IUCiOFGAKFCUEWAQEBAQEBAQEBAQE?= =?us-ascii?q?SAQEBCAsLCCgvgjgigkMBAQEDASMEGQEbHQEDAQsGAwIEBw0nAwICIQEBEQEFA?= =?us-ascii?q?QsRBhOKBwEDDQgQjRiRG0CMDIFtGAUBHIMJBYNlChknDViDAQEBAQEBAQEBAQE?= =?us-ascii?q?BAQEBAQEBAQEBARUCAQUSgx2CB1R9hRiCXoIHAQFLgmeCYQWhFzwCgkMBhRuIF?= =?us-ascii?q?YR5kxmNBohaFCSBFSUBggx6XjWCL4JNH4FzQDaIMYI1AQEB?= X-IPAS-Result: =?us-ascii?q?A0AcAQDptehZhinXVdFdHAEBBAEBCgEBFwEBBAEBCgEBhBh?= =?us-ascii?q?uJ4N6gTaYIoF6kHSFP4IUCiOFGAKFCUEWAQEBAQEBAQEBAQESAQEBCAsLCCgvg?= =?us-ascii?q?jgigkMBAQEDASMEGQEbHQEDAQsGAwIEBw0nAwICIQEBEQEFAQsRBhOKBwEDDQg?= =?us-ascii?q?QjRiRG0CMDIFtGAUBHIMJBYNlChknDViDAQEBAQEBAQEBAQEBAQEBAQEBAQEBA?= =?us-ascii?q?RUCAQUSgx2CB1R9hRiCXoIHAQFLgmeCYQWhFzwCgkMBhRuIFYR5kxmNBohaFCS?= =?us-ascii?q?BFSUBggx6XjWCL4JNH4FzQDaIMYI1AQEB?= X-IronPort-AV: E=Sophos;i="5.43,402,1503352800"; d="scan'208,217";a="297021442" Received: from mail-lf0-f41.google.com ([209.85.215.41]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 19 Oct 2017 16:29:11 +0200 Received: by mail-lf0-f41.google.com with SMTP id k40so9845291lfi.4 for ; Thu, 19 Oct 2017 07:29:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Yx//paD6Ahmj7GG4qDT/TH7JiXxhE04DrUvvviEFeXQ=; b=MxAGYxZKtKzK8scm4eQN8E6Ft1RLW+8vAFCpqqXP2Lduy46fr9afBNv5k7pGBEhn37 BHJB43FdQRrqMhXm8TpVFGthj3T3p2wzVBbBLQF4CZ1M7L49QZwYOviQ9ZuBgDg+/sjB YCu/K/B3fp48ayOQ0qUZKoTZFRNVKl580LznfQ80ShL5ggOjZ73RQ1pxlRRTnj0PvRW8 CCEE5XHb349a2uZaVXZ9Atuo7Cu6AGy2WXoa/0EeLcwRAMxy4kxKTxBk/mLYCW+bNHkA cd55OahZOtTI0ltTm5G0k/47Y62ymxcf9j6qSqiW3ARJGJsMSrNnDAdmJGhhbQHvVpcy xTfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Yx//paD6Ahmj7GG4qDT/TH7JiXxhE04DrUvvviEFeXQ=; b=s220rGw5FdNLG8flGcN420AtapHvAO1tYcmMx+lSsS/Q23gFxOhFfb/SgVpvto+cWT q8Cq572/admJ16vg3rk5HdwcqnlJ6ZXN9Xa4ynisH7qesMvx9rmCmOGirWbeDxN74nSM 3xHTJvlBH9GXv/LqOaYQ0IGaKZ7sAq6u4VC5r2uxwqqykbWR+JLPl0tA9ZW0WjfZ7W55 MxO5ox7T46Y0HpDiajLqZ32N8BNEfYAxNSIEn9JFwco8YA493KbN9SYTbyWUW0UniHmG geQabVT0igoQBKL3xPzG2LvaPm42KYUIFykBLnEV5fuf34ajmUEW4crsz7CezxrQQCks xQHg== X-Gm-Message-State: AMCzsaWSK6pxhcW4BqVJCuKVnGbhqB4+of2KNtz/eCGPufuj6Mg3x+Hj shbOSxCnO6AJq1xLdYIGCLKGe1NKJE6RTsaYum0= X-Google-Smtp-Source: ABhQp+TH/QFpEEALmFLC6X/o8h83o3byTbpzvEVenhiSG1cAAd/umLrCEDhaEod19eYYFYHATFmHdmVlsUs5Xnk2nZM= X-Received: by 10.25.149.131 with SMTP id x125mr692986lfd.231.1508423350626; Thu, 19 Oct 2017 07:29:10 -0700 (PDT) MIME-Version: 1.0 References: <72565dd8-08e0-0fd3-a3df-6742e1957ec3@matej-kosik.net> <2a85acfe-9154-fc07-6265-a1847f883d00@matej-kosik.net> In-Reply-To: <2a85acfe-9154-fc07-6265-a1847f883d00@matej-kosik.net> From: "vrotaru.md@gmail.com" Date: Thu, 19 Oct 2017 14:29:00 +0000 Message-ID: To: =?UTF-8?B?TWF0ZWogS2/FocOtaw==?= Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary="001a114022c4fc2dea055be72d58" Subject: Re: [Caml-list] beginner question about pattern matching --001a114022c4fc2dea055be72d58 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Rtag ((_,_,_,_) as t4) -> t4 Will this work? Writing from the phone On Thu, Oct 19, 2017, 17:24 Matej Ko=C5=A1=C3=ADk wr= ote: > On 10/19/2017 04:16 PM, vrotaru.md@gmail.com wrote: > > [ Rtag (_,_,_,_) as rtag] -> rtag > > That is certainly possible. > It is equivalent to: > > | [rtag] -> rtag > > but that's not what I am trying to do. :-/ > > Instead of the whole > > Rtag (something1, something2, something3, something4) > > I would like to bind just the 4-tuple > (without the Rtag label). > > > > > > > On Thu, Oct 19, 2017, 16:39 Matej Ko=C5=A1=C3=ADk mail@matej-kosik.net>> wrote: > > > > Hi, > > > > I am trying to do simple pattern matching of these values: > > https://github.com/ocaml/ocaml/blob/trunk/parsing/parsetree.mli#L145 > > > > What I would like to do is: > > > > | [Rtag the_whole_4_tuple] -> > > the_whole_4_tuple > > > > However, when I try to do that, I am getting: > > > > Error: The constructor Rtag expects 4 argument(s), > > but is applied here to 1 argument(s) > > > > This: > > > > | [Rtag (f1,f2,f3,f4)] -> > > f1,f2,f3,f4 > > > > of course works but (regardless of the chosen bound variable names), > it looks amateurish. > > > > What's the right way to do this? > > (I would like just to bind a 4-tuple and then return it) > > > > (Apologies in advance for a stupid question.) > > > > --001a114022c4fc2dea055be72d58 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Rtag ((_,_,_,_) as t4) -> t4

Will this work? Writing from the phone


On Thu, Oct 19, 2017, 17:24= Matej Ko=C5=A1=C3=ADk <mail@mat= ej-kosik.net> wrote:
On 10/1= 9/2017 04:16 PM, = vrotaru.md@gmail.com wrote:
> [ Rtag (_,_,_,_) as rtag] -> rtag

That is certainly possible.
It is equivalent to:

=C2=A0 | [rtag] -> rtag

but that's not what I am trying to do.=C2=A0 :-/

Instead of the whole

=C2=A0 Rtag (something1, something2, something3, something4)

I would like to bind just the 4-tuple
(without the Rtag label).

>
>
> On Thu, Oct 19, 2017, 16:39 Matej Ko=C5=A1=C3=ADk <mail@matej-kosik.net <mail= to:mail@matej-kos= ik.net>> wrote:
>
>=C2=A0 =C2=A0 =C2=A0Hi,
>
>=C2=A0 =C2=A0 =C2=A0I am trying to do simple pattern matching of these = values:
>=C2=A0 =C2=A0 =C2=A0https://= github.com/ocaml/ocaml/blob/trunk/parsing/parsetree.mli#L145
>
>=C2=A0 =C2=A0 =C2=A0What I would like to do is:
>
>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0| [Rtag the_whole_4_tuple] ->
>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0the_whole_4_tuple
>
>=C2=A0 =C2=A0 =C2=A0However, when I try to do that, I am getting:
>
>=C2=A0 =C2=A0 =C2=A0=C2=A0 Error: The constructor Rtag expects 4 argume= nt(s),
>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0but is applied he= re to 1 argument(s)
>
>=C2=A0 =C2=A0 =C2=A0This:
>
>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 | [Rtag (f1,f2,f3,f4)] ->
>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 f1,f2,f3,f4
>
>=C2=A0 =C2=A0 =C2=A0of course works but (regardless of the chosen bound= variable names), it looks amateurish.
>
>=C2=A0 =C2=A0 =C2=A0What's the right way to do this?
>=C2=A0 =C2=A0 =C2=A0(I would like just to bind a 4-tuple and then retur= n it)
>
>=C2=A0 =C2=A0 =C2=A0(Apologies in advance for a stupid question.)
>

--001a114022c4fc2dea055be72d58--