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 472FA80211 for ; Thu, 19 Oct 2017 16:35:24 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gabriel.scherer@gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer@gmail.com; spf=None smtp.helo=postmaster@mail-qk0-f171.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.220.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.220.171 as permitted sender) identity=mailfrom; client-ip=209.85.220.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@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-qk0-f171.google.com) identity=helo; client-ip=209.85.220.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-qk0-f171.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AYeyscB3UNc/GcAn1smDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?seseK/ad9pjvdHbS+e9qxAeQG96Eu7QZ06L/iOPJZy8p2d65qncMcZhBBVcuqP?= =?us-ascii?q?49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tLw6annrnyDcOFxe3Fg2H?= =?us-ascii?q?o+e9TovbjsCf0umu9p+WYAJThTn7Z75uekaYtwLU4+Yfi5FjJ6J58RDJr2FFYa?= =?us-ascii?q?wCympiP1Oem1Dn7ce95pN52ytVsvMlscVHVPOpLOwDUbVEAWF+YCgO78rxuEyb?= =?us-ascii?q?QA=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0C6AAASt+hZhqvcVdFdGwEBAQMBAQEJA?= =?us-ascii?q?QEBFwEBBAEBCgEBhBhuJweDc5lYgXqJOY8OCiOFGAKFAgdDFAEBAQEBAQEBAQE?= =?us-ascii?q?BEgEBAQgLCwgoL4I4IoJEAQUjBBkBGx0BAwwGAwILDQICJgICIgERAQUBHAYTi?= =?us-ascii?q?gcBAxUQjRyRG0CMDIFtGAUBHIMJBYNlChknDViDAQEBAQEBBQEBAQEBARoCAQU?= =?us-ascii?q?SfYIgggeBUYUYhGUBAR6DFIJhBaFTgi+FMo0OkxmVYBQFH4EVNoF8NCElXjWCL?= =?us-ascii?q?4JNH4F1PjaIMYI1AQEB?= X-IPAS-Result: =?us-ascii?q?A0C6AAASt+hZhqvcVdFdGwEBAQMBAQEJAQEBFwEBBAEBCgE?= =?us-ascii?q?BhBhuJweDc5lYgXqJOY8OCiOFGAKFAgdDFAEBAQEBAQEBAQEBEgEBAQgLCwgoL?= =?us-ascii?q?4I4IoJEAQUjBBkBGx0BAwwGAwILDQICJgICIgERAQUBHAYTigcBAxUQjRyRG0C?= =?us-ascii?q?MDIFtGAUBHIMJBYNlChknDViDAQEBAQEBBQEBAQEBARoCAQUSfYIgggeBUYUYh?= =?us-ascii?q?GUBAR6DFIJhBaFTgi+FMo0OkxmVYBQFH4EVNoF8NCElXjWCL4JNH4F1PjaIMYI?= =?us-ascii?q?1AQEB?= X-IronPort-AV: E=Sophos;i="5.43,402,1503352800"; d="scan'208";a="241666243" Received: from mail-qk0-f171.google.com ([209.85.220.171]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 19 Oct 2017 16:35:23 +0200 Received: by mail-qk0-f171.google.com with SMTP id w134so10613068qkb.0 for ; Thu, 19 Oct 2017 07:35:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=yAyxsmSynaaFulg9BLyehEE/y9W+TE1/N3/2t7duT3c=; b=Zq5X09n8EIqqfvYOq4KaVv9ulR89FlmTs2F5LLM0gny5skC3ct0zTLNp4rAzg0IV0r wB1jXIoJyaIrBXsoWC+N0V7imw8KWFxOi8cf75T/Jg1VdlC1t9PYOGAg0dATP2RkNOge N3f7ybOU0BtdcfKctplr3PtiYbrWwbNDeWaRY65R2L32OptqC7Pwl3Kys4iCo2X2ehiD lV4O+K1gdqnfWPe4s0A5A/v09mGx5dbbx5NQNGd+b5IVhaKOVup5k0OBzakLHGQv1egp bTHHcjtkNmph9h8qr4oHjdLQY7stSHQXMvr5KbdbmBq1d0GNTY7vV0sk5Km60dC1XC7s pQ1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=yAyxsmSynaaFulg9BLyehEE/y9W+TE1/N3/2t7duT3c=; b=gSUQh3KhRHa+coJs+LRRCM444UraPwdaSvQ/3565DrIa8+6wCyJvLypIiVGr0fbLbT 3+ODYWntaTMJdZcG1BLQZ5mAIzctbfhZwj3wkbyiroReY7YfSo9GqfVYE1QfacBgw16g H3nhPjZ9A4AMX9WbnNSHPS0TsZaqr6C86xkzSSIAIKyUCUPH2xTprFM4WsSJno0rZA/d ARXx51kTqNqQUXFoO7gpcEyvF/+1eKP/ipJx3XyhvudCdjjKHg71GlI6d0Y8ter3I3Kr e/lJrsNFubDU505eK3oEcM3pxwb/kNEcfgXqZFwH4XLGJRYZQKo2ANvnlmPBNka2kqJE XDzg== X-Gm-Message-State: AMCzsaVXg8Dukz3p4GQhE9jSjDL+mNDJVG/EJWqzrUZdSLvq8SkqeFnZ N3/+PDOfNpW9imNb6UdDYZqBCiYMxO2DC41YqYi7uQ== X-Google-Smtp-Source: ABhQp+TTrsFD3eQZyhZoezookkkbi5IFigAp12xgav4yIkIDnykHWlxhlMKT0YYEuKydM1ZVkCIoLH47l/p62XAFyAc= X-Received: by 10.55.44.67 with SMTP id s64mr2145782qkh.284.1508423722160; Thu, 19 Oct 2017 07:35:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.178.65 with HTTP; Thu, 19 Oct 2017 07:34:41 -0700 (PDT) In-Reply-To: <72565dd8-08e0-0fd3-a3df-6742e1957ec3@matej-kosik.net> References: <72565dd8-08e0-0fd3-a3df-6742e1957ec3@matej-kosik.net> From: Gabriel Scherer Date: Thu, 19 Oct 2017 16:34:41 +0200 Message-ID: To: =?UTF-8?B?TWF0ZWogS2/FocOtaw==?= Cc: caml users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] beginner question about pattern matching This is a small hiccup with the OCaml (non-revised) syntax: | Foo of bar * baz * blah and | Foo of (bar * baz * blah) are not equivalent, and only the latter allows to do what you want. On Thu, Oct 19, 2017 at 3:38 PM, Matej Ko=C5=A1=C3=ADk 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 l= ooks 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.) >