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 A71EC80211 for ; Thu, 19 Oct 2017 16:24:47 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=mail@matej-kosik.net; spf=SoftFail smtp.mailfrom=mail@matej-kosik.net; spf=SoftFail smtp.helo=postmaster@matej-kosik.net Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of mail@matej-kosik.net) identity=pra; client-ip=145.239.83.105; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mail@matej-kosik.net"; x-sender="mail@matej-kosik.net"; x-conformance=sidf_compatible Received-SPF: SoftFail (mail3-smtp-sop.national.inria.fr: domain of mail@matej-kosik.net is inclined to not designate 145.239.83.105 as permitted sender) identity=mailfrom; client-ip=145.239.83.105; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mail@matej-kosik.net"; x-sender="mail@matej-kosik.net"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: SoftFail (mail3-smtp-sop.national.inria.fr: domain of postmaster@matej-kosik.net is inclined to not designate 145.239.83.105 as permitted sender) identity=helo; client-ip=145.239.83.105; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mail@matej-kosik.net"; x-sender="postmaster@matej-kosik.net"; x-conformance=sidf_compatible; x-record-type="v=spf1" IronPort-PHdr: =?us-ascii?q?9a23=3ASx8MgRD/XGUz72yDZkb1UyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSP77osbcNUDSrc9gkEXOFd2Crakb26yL6+jJYi8p39WoiDg6aptCVhsI24?= =?us-ascii?q?09vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6lCs4CQtGhTjOE8w?= =?us-ascii?q?D6y1X9eK14Xkn9y1rtfNeQJUjSCgJ7Z+BBqzpATV8MIRhMEqfrgrzQfAuGYOfu?= =?us-ascii?q?h+ymZhJFbVlBH5sJSe5plmpgFZp/8jv+1HoyD5N/A9RL1cJDEvL203oc7srhjA?= =?us-ascii?q?Cw2C+i1PAS0tjhNUDl2dv1nBVZDrv36/77Il1Q=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AqDAC1tOhZZGlT75FdHAEBBAEBCgEBG?= =?us-ascii?q?AEFAQsBgzRkA2sng3qLE5AZJohJjWqCFAcmhRgChQhBFwEBAQEBAQEBAQEBA4E?= =?us-ascii?q?EC4I4JAGCQAEBAQMBIwRSEAkCGCcDAgIhJREGDQYCAQGKBAMNDAyNG51ngW06h?= =?us-ascii?q?z0Ng1kBAQEBAQUBAQEBFQoFgy+CW4MSC4J4gl6CBwEBgzKCYQWhFzyEP4IhgQG?= =?us-ascii?q?IFZBfhzONBoonIAE1gVyBBQpJgmSEYXSIMYI1AQEB?= X-IPAS-Result: =?us-ascii?q?A0AqDAC1tOhZZGlT75FdHAEBBAEBCgEBGAEFAQsBgzRkA2s?= =?us-ascii?q?ng3qLE5AZJohJjWqCFAcmhRgChQhBFwEBAQEBAQEBAQEBA4EEC4I4JAGCQAEBA?= =?us-ascii?q?QMBIwRSEAkCGCcDAgIhJREGDQYCAQGKBAMNDAyNG51ngW06hz0Ng1kBAQEBAQU?= =?us-ascii?q?BAQEBFQoFgy+CW4MSC4J4gl6CBwEBgzKCYQWhFzyEP4IhgQGIFZBfhzONBoonI?= =?us-ascii?q?AE1gVyBBQpJgmSEYXSIMYI1AQEB?= X-IronPort-AV: E=Sophos;i="5.43,402,1503352800"; d="asc'?scan'208";a="241664157" Received: from 105.ip-145-239-83.eu (HELO matej-kosik.net) ([145.239.83.105]) by mail3-smtp-sop.national.inria.fr with ESMTP; 19 Oct 2017 16:24:46 +0200 Received: from [192.168.1.10] (adsl-dyn234.78-99-243.t-com.sk [78.99.243.234]) by matej-kosik.net (Postfix) with ESMTPSA id 34A7E1F59F; Thu, 19 Oct 2017 16:24:46 +0200 (CEST) To: "vrotaru.md@gmail.com" Cc: caml-list@inria.fr References: <72565dd8-08e0-0fd3-a3df-6742e1957ec3@matej-kosik.net> From: =?UTF-8?B?TWF0ZWogS2/FocOtaw==?= Openpgp: id=1CD41D0A52319DC7ABC1B79F50AFFA128CE48649; url=http://matej-kosik.net/doc/kosik.asc Message-ID: <2a85acfe-9154-fc07-6265-a1847f883d00@matej-kosik.net> Date: Thu, 19 Oct 2017 16:24:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="p7ti1ckbnM1J2lCDdMG2fRGdL6HgNOIt5" Subject: Re: [Caml-list] beginner question about pattern matching This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --p7ti1ckbnM1J2lCDdMG2fRGdL6HgNOIt5 Content-Type: multipart/mixed; boundary="jqnAUNaLP7UaA3eGeovhFpwAoolk4oAfx"; protected-headers="v1" From: =?UTF-8?B?TWF0ZWogS2/FocOtaw==?= To: "vrotaru.md@gmail.com" Cc: caml-list@inria.fr Message-ID: <2a85acfe-9154-fc07-6265-a1847f883d00@matej-kosik.net> Subject: Re: [Caml-list] beginner question about pattern matching References: <72565dd8-08e0-0fd3-a3df-6742e1957ec3@matej-kosik.net> In-Reply-To: --jqnAUNaLP7UaA3eGeovhFpwAoolk4oAfx Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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). >=20 >=20 > On Thu, Oct 19, 2017, 16:39 Matej Ko=C5=A1=C3=ADk > wrote: >=20 > Hi, >=20 > I am trying to do simple pattern matching of these values: > https://github.com/ocaml/ocaml/blob/trunk/parsing/parsetree.mli#L145 >=20 > What I would like to do is: >=20 > =C2=A0 =C2=A0| [Rtag the_whole_4_tuple] -> > =C2=A0 =C2=A0 =C2=A0 =C2=A0the_whole_4_tuple >=20 > However, when I try to do that, I am getting: >=20 > =C2=A0 Error: The constructor Rtag expects 4 argument(s), > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0but is applied here to 1 argument(s) >=20 > This: >=20 > =C2=A0 =C2=A0 | [Rtag (f1,f2,f3,f4)] -> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 f1,f2,f3,f4 >=20 > of course works but (regardless of the chosen bound variable names), = it looks amateurish. >=20 > What's the right way to do this? > (I would like just to bind a 4-tuple and then return it) >=20 > (Apologies in advance for a stupid question.) >=20 --jqnAUNaLP7UaA3eGeovhFpwAoolk4oAfx-- --p7ti1ckbnM1J2lCDdMG2fRGdL6HgNOIt5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEHNQdClIxncerwbefUK/6EozkhkkFAlnotawACgkQUK/6Eozk hkn7Ow//c7y6TrQOakb/nGFbIv15W/IfmznznDBg/TgRSHpNw5DaJAhbNL5iB6rX L0uKSRMxDTZ4KapylRyuJ+G2vGdKfsKw6E0VSFzwQagpBGmQgIQ4EpPYSO+JJEUy HR8cRZk5LVsby9nHLH9LZLZ4Yi6eGiKghxLIDrYHO41zpB1hLaDWVswfG0QdEf9i ehvFJBfu9wvj6JAes6IOHNupdmD6q1MUkWu4WRnop0oNMERwiY9THqADY5AW36Mh VELlC+2vQhY9A9Dnud9kPSmeKkOPvQBR9fqDDJ+nYtw8/8QyRPisGCM/sdnh8Ayj 1e1vJYXOtQZV/ykePD7SmGIQlViuHOspBYtLEBN0P8J8Sjx30z5FUQRXOd62aNP5 fNBcu2iqYfbV6RTC65n88LHNyu16O+yHhQJehcf8jMSJ3Cm7+S00Lwf2wz07JPM7 mPVLUuzGvPGm12kKOq5wm2aVbzNMWYayuGY6n7fPEV6uDwYMKOGcKH5lAUJkgVXv i5kI6DE+Co+e5Z12WDJIs4TYLToEeA69y5zqPESR8pLwlke+eIpOQOGAtDceTP/4 tYqchfSzXNfRurUw+cpNgzhq2NNy3sx/Db2XVug+18AKV6jAahnBMG+zh/d9KpMd oKYd5moP8fdv7swea6WjA9f/Dg9PpRwLl2T7GOUmhR6OkYVodtM= =nZpz -----END PGP SIGNATURE----- --p7ti1ckbnM1J2lCDdMG2fRGdL6HgNOIt5--