From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTP id F3FA95D4 for ; Fri, 27 Jul 2018 19:26:22 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.51,410,1526335200"; d="scan'208";a="340539701" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 27 Jul 2018 21:26:21 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id E20D5824B6; Fri, 27 Jul 2018 21:26:20 +0200 (CEST) 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 EB99C81792 for ; Fri, 27 Jul 2018 21:26:14 +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-lf1-f54.google.com IronPort-PHdr: =?us-ascii?q?9a23=3AzZxm5Bx+IuZUInzXCy+O+j09IxM/srCxBDY+r6Qd?= =?us-ascii?q?2+oSIJqq85mqBkHD//Il1AaPAd2Fraocw8Pt8InYEVQa5piAtH1QOLdtbDQizf?= =?us-ascii?q?ssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBBr/KRB1?= =?us-ascii?q?JuPoEYLOksi7ze+/94HSbglSmDaxfa55IQmrownWqsQYm5ZpJLwryhvOrHtIeu?= =?us-ascii?q?BWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3o05MLwqxbO?= =?us-ascii?q?SxaE62YGXWUXlhpIBBXF7A3/U5zsvCb2qvZx1S+HNsDtU7s6RSqt4LtqSB/wiS?= =?us-ascii?q?cIKTg58H3MisdtiK5XuQ+tqwBjz4LRZoyeKfhwcb7Hfd4CSmVBUMReWSxPDI2/?= =?us-ascii?q?coUBEfYOM+lDoonhvlsDtweyCRWwCO7tzDJDm3/43bc90+QkCQzI3RYvEMkUsH?= =?us-ascii?q?TVstr1MLoZX/2pw6nI0zrDde1Z2S3g44XPfRAuu+qDXahxccXPzUkjDRjFgUmQ?= =?us-ascii?q?qYP7JTOayP4NvnOU7+plT+2vimonpxttrTiow8chk4/EjZ8WxFDc7Sh13po5KN?= =?us-ascii?q?miREN4YdOoCoZcuiCYOodsQs4vTGdlszsgxLIco560Zi0KxYwnxxHBb/yHdJCF?= =?us-ascii?q?4hf5W+aQJTd0nXZleLyiixqr/0ityuLxWtO70FZNqSpFnd3MuW4X2xPP7ciHT+?= =?us-ascii?q?Nx/kan2TmRywDe8v9ILVwwmKbBKJMswqQ8mocSvEnBBCP7mEr7gLeTdko+++io?= =?us-ascii?q?7+rnYq/hpp+ZL4J0hRvxPb80msy+H+s4NhICX3OH9uS8yrLj51P2QK9Rg/05l6?= =?us-ascii?q?nWqpHaJcABqqGlBA9V154v6wyjADe+zNQYgX4HIUpZdx2diojpP0jCIPT5Dfek?= =?us-ascii?q?n1ShiyxrxvDDPr35GJrBNHnDkLH7fbZ88UFQ0gQzzcoMr65TX5IMJvT+Rk+5nd?= =?us-ascii?q?DRC1ccMgiwzvyvXNZw0IUTRWKGDqacNaLWtVKSzu0qKuiIIoQSvWCuBeIi4qvB?= =?us-ascii?q?hHUjmFIZNZKi3ZYNZWrwSvtvKV+YbH6qmdwBHH0HpCIxSeXrjBuJVjsFNCX6ZL?= =?us-ascii?q?41+jxuUNHuNozEXI34xeXZhH7qTK0TXXhPDxW3KVmtcoyFX/kWbyfLe51ulzUF?= =?us-ascii?q?Uf6qTIpzjEjy5j+/8KJuK6/vwgNdrYjqjYEn6OjalBV0/jtxXZzEjjO9Clpsl2?= =?us-ascii?q?ZNfAcYmaBypUsnlwWG2Kl8xvhWTJlduq8PXQA9OprRied9DoKqVw=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BsBQB+cVtbhjanVdFbHgEGDIMgUgGBP?= =?us-ascii?q?RUTg36DbZBVggyIT458C4RsAoJ7GQcBBDQUAQIBAQIBAQEBARMBAQEICwsIGw4?= =?us-ascii?q?jDEIMAYFmJAGCXQECAyMdARsdAQMMBgULDQICJgICIQEBEQEFARwGE4MggWcBA?= =?us-ascii?q?xWiEjyLCYERBQEXgnUFg1UKGSYNV4JLAgYSeYd3gVg/g241glaCJ4MBglUCmWA?= =?us-ascii?q?rBwKBdIo2gwyBSIcKhTSLIYcEDyGBN4FzMxojUDGCOIIZGoNOilQ9MIdFiBIBA?= =?us-ascii?q?Q?= X-IPAS-Result: =?us-ascii?q?A0BsBQB+cVtbhjanVdFbHgEGDIMgUgGBPRUTg36DbZBVggy?= =?us-ascii?q?IT458C4RsAoJ7GQcBBDQUAQIBAQIBAQEBARMBAQEICwsIGw4jDEIMAYFmJAGCX?= =?us-ascii?q?QECAyMdARsdAQMMBgULDQICJgICIQEBEQEFARwGE4MggWcBAxWiEjyLCYERBQE?= =?us-ascii?q?XgnUFg1UKGSYNV4JLAgYSeYd3gVg/g241glaCJ4MBglUCmWArBwKBdIo2gwyBS?= =?us-ascii?q?IcKhTSLIYcEDyGBN4FzMxojUDGCOIIZGoNOilQ9MIdFiBIBAQ?= X-IronPort-AV: E=Sophos;i="5.51,410,1526335200"; d="scan'208";a="274274532" Received: from mail-lf1-f54.google.com ([209.85.167.54]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 27 Jul 2018 21:26:12 +0200 Received: by mail-lf1-f54.google.com with SMTP id f18-v6so4252625lfc.2 for ; Fri, 27 Jul 2018 12:26:12 -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:content-transfer-encoding; bh=m4/3tV0YlAm7uMTsqY22AfcgzmnIYpEY3bd3CNFdVV4=; b=t4COtG/X0Vhz15iFW7UAiHLvDOlYOk9dkX36oca9iBGw5qItTfRLM3MNABNo7MPMnm G0rok8vGUiYeFh69v3Z9I+elgoSLswWv5mKpm21tzxKXhrbVDg2Itg3CnIW7AZNQ/z6c KwVSalPjRFLXjFa485KqtFxpQAPFYzDUkEaLDqViqXf+emzJG/L48waMar6FNiflnMLV csaK5ErS6XdROiZM07MGQw2JufgCcRDt50V6faJiHGyFJ8veNYYcPsqA7toHmJFOwDuY DNqWgPKfymHZ98rGKWn0isl3E8yLxx7VPhRRwWJCaLs+z5ZxDIPt2tzlUb06+6P+u6xS Yoeg== 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:content-transfer-encoding; bh=m4/3tV0YlAm7uMTsqY22AfcgzmnIYpEY3bd3CNFdVV4=; b=uGdaBLUbjCAE0RJhEJPX4vJqWH3xeLbg9CGEiaQGVnd0wKeKGC6yAB8/gCuoHZETzu y5TEL3ndGZTT0g9UgVXsaQ/5HiE1cTIvmBNy4VkMGLBR0MaUUlrSLBL6y9JS4B/HnRWO ULidZ+eikd8dwB5PixtxUOLFO+mFssZDlvPBnqMlsHv9pZ89E7hQCQpoq17IzccurDBM nNd0pV+YGBKSYqXFVdS5zA3xLn9k9Tgq4XEFazgL/kpBiP43xsulqw6+665ocniuU3lN YwmTtOFM0e73yBOfV95uoVINvwdyvisr8tsUbDB4TIk7pQj3zanyuXAcVqTsLfaP62n1 a24w== X-Gm-Message-State: AOUpUlHsqXqrsaR9lsacvCUnZjowMGKM9zI4YEvuh9dQGswU+BLLNUyK Ou4TnOanABAY3kFM/buHPbD37l3ECdA9OibDfpXdyQ== X-Google-Smtp-Source: AAOMgpfhffdP84+yLrpakDUQZoYZEz/JCx7YiFyciiR8x7+RClOLqUbVWK8jhTmFBbgdMkfIF80ODSE4NLkcTQN8th4= X-Received: by 2002:a19:cc0f:: with SMTP id c15-v6mr4567596lfg.145.1532719571796; Fri, 27 Jul 2018 12:26:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Gabriel Scherer Date: Fri, 27 Jul 2018 21:34:12 +0200 Message-ID: To: Kenneth Adam Miller Cc: caml users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] cmdliner difficulties Reply-To: Gabriel Scherer X-Loop: caml-list@inria.fr X-Sequence: 17013 Errors-to: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: I would write a dedicated parser (typically using (ocamllex or sedlex) and Menhir), and I don't think this is a problematic approach at all. It would also turn out to be very useful if you later decided to also be able to read these set expressions from other inputs, such as configuration files. On Fri, Jul 27, 2018 at 8:11 PM Kenneth Adam Miller wrote: > > Hello, > > > I have a task where I need to have command liner allow a sequence of vari= ous different types compose a certain way without having to write a small l= anguage for what belongs on the command line. > > Basically, I am trying to color a graph with different operations on the = command line in such a way that different colors can be specified as the ta= rget of results of set operations against names of sets. For example: > > --color Red=3D(Feature1 MINUS Feature2) > > There are a predefined set of colors and features, and some operations th= at can be performed. However, because it's a grammar just like any language= , there might be arbitrarily deep expressions, and because the command line= won't have me constructing this in a straight forward way without writing = a dedicated type parser, which might not be so clean. > > There are operations: difference, union, intersection, and cut. These can= recur, and there are predefined list of colors that can be the targets of = these results, which are calculated from sources that are features. In addi= tion, the specification of colorings can be multiple, as in --color ... --c= olor ... > > Can anybody see where they would overcome some of these difficulties? --=20 Caml-list mailing list. Subscription management and archives: https://sympa.inria.fr/sympa/arc/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs=