Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id s8F7PoJ7015844 for ; Mon, 15 Sep 2014 09:25:51 +0200 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx007) with ESMTPS (Nemesis) id 0MT79a-1XsHJ01qdi-00S6gf for ; Mon, 15 Sep 2014 09:25:45 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s8F7Ms5E027542 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 15 Sep 2014 09:22:54 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s8F7F7dP031712; Mon, 15 Sep 2014 09:22:54 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 11291644 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 15 Sep 2014 09:22:54 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s8F7MriW032321 for ; Mon, 15 Sep 2014 09:22:53 +0200 Received: from smtp2.easily.co.uk (smtp2.easily.co.uk [91.194.151.17]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s8F7MZ1D027327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 15 Sep 2014 09:22:38 +0200 Received: from [109.158.103.69] (port=63424 helo=palladium.home) by smtp2.easily.co.uk with esmtpa (Exim 4.43) id 1XTQcI-0001yf-5I for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 15 Sep 2014 08:22:30 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 References: <54167155.9070304@clear.net.nz> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <541693B5.2000103@morningstar2.co.uk> Date: Mon, 15 Sep 2014 08:22:29 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: Generalising \cs_generate_variant To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <54167155.9070304@clear.net.nz> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:iKgmUtxo4HE=:VW0RIPiYvgBZYGrPaGoE0hyZfh LKos8EaDmGnWD8VCFU1Xhv6OK0CV/JMx9YOV4cwnT7QAs8OQ+XeFQcN5b0KVv5oDYu+1hr9Xd onOL68VEAANUWQjgZjnA/fPzLLStO8uQmCHlH/mHHbFBegrOYFuaQwhdTK+Tzfw5xwBEAMs2z LCHUjKPZF8zQAV/S9M0vB8pwCXM2bEWAi2iiTkG4ZE7/5XqsezGsxXt/9OL05yWhf7G10Ke32 dB9NubahM/Gb1PuYbQIY8ldOqppOGW1Izvhc61u4xk8WKU/Fwe/YIca1H0fISpX6xbXAr5U8q VRmOZjkRT7FFG7C5eFKQjPzHHkqEo6T9mDyAKJ6OFccZEMdyZDjIiRQFyYYQH6WHJwFgLVG4y IOYO/X0Oe5ZU9WTTm3NY9EYM3Kq5C4B91WxPTG2T6/8kzCNnFM2c1BeltEUmNjZdObtyxAfHO 6sPDgF9BzwBsrthu9vJhUG/bI5/ad3YxYg6AcSpchNpPdp8qqpUwhcyRV1mgAxXE/yRrg4oXP ejv+sSUiGkpXAz5hv4DA5eR81FEOsito8CNHz5k4QMWWOaMfYJ6mlcULNw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, aparsloe wrote: > I have found a number of instances where I have wanted to generate a > variant with varying degrees of branching, e.g. > > \cs_generate_variant:Nn \tl_case:Nn { No } > \cs_generate_variant:Nn \tl_case:NnT { No } > \cs_generate_variant:Nn \tl_case:NnF { No } > > I find myself envious of the functionality available with > \prg_new_conditional:Npnn and its ilk where multiple degrees of > branching can be coded in a single statement using a subset of { p, F, > T, TF }. It would be nice to be able to write something similar, e.g. > > \cs_generate_variant:Nnn \tl_case:Nn { No } { , F, T } > > where the empty slot before the first comma denotes the nonbranching > variant. > > I don't imagine I'm the first to have thought this, so presumably there > is good (or at least some) reason for not providing the functionality. > It would be good to know. > > Andrew I don't remember any technical reasons for not doing this: I guess primarily we've not needed it often enough. Probably this would go into \prg_... as it's only applicable to conditionals (we have \prg_new_eq_conditional:NNn and \prg_set_eq_conditional:NNn). I guess something like \prg_generate_conditional_variant:Nnn would be an appropriate name. Thoughts? -- Joseph Wright