Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id q12IcRpF005508 for ; Thu, 2 Feb 2012 19:38:28 +0100 Received: (qmail 29667 invoked by alias); 2 Feb 2012 18:38:22 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 02 Feb 2012 18:38:21 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx109) with SMTP; 02 Feb 2012 19:38:21 +0100 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 q12Ia475030643 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Feb 2012 19:36:04 +0100 Received: from listserv.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id q12I7Z9b005897; Thu, 2 Feb 2012 19:36:03 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 2066996 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Thu, 2 Feb 2012 19:36:03 +0100 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id q12Ia3AI000426 for ; Thu, 2 Feb 2012 19:36:03 +0100 Received: from mail-lpp01m010-f49.google.com (mail-lpp01m010-f49.google.com [209.85.215.49]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id q12IZwug030581 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Thu, 2 Feb 2012 19:36:03 +0100 Received: by laam7 with SMTP id m7so2001022laa.22 for ; Thu, 02 Feb 2012 10:35:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.152.128.133 with SMTP id no5mr1687616lab.31.1328207758760; Thu, 02 Feb 2012 10:35:58 -0800 (PST) Received: by 10.152.13.106 with HTTP; Thu, 2 Feb 2012 10:35:58 -0800 (PST) References: <20120202102957.GB14566@csmvddesktop> <4F2A68F9.1010508@morningstar2.co.uk> <20120202111808.GA15304@csmvddesktop> <4F2AC338.2060505@residenset.net> Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Whitelist: Message-ID: Date: Thu, 2 Feb 2012 13:35:58 -0500 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: Mapping Functions Versions for All and Some To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <4F2AC338.2060505@residenset.net> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (BackTrace mail analyze); Detail=5D7Q89H36p4L00VTXC6D4q0N+AH0PUCnGL2vqOgpaBYL16oitsMrgDt/NQNpSCZFFjDOy 97xb7Zpf+wZnd5ZXNcvLDXR3Wg3wRjdQbwEMh8=V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 7010 Hi Lars, >> I've been wondering: should it be called "regex" or "regexp"? > > My preference is for "regexp", but I can see it might by now be a bit > awkward to change it. My original argument in favor of regex (besides the fact that Wikipedia's regex(p|) page uses that and that it's shorter) is that it matches nicely with (La|)TeX. Before I planned to include it in LaTeX3, I thought of calling the package ReGeX. :-) >> Like Joseph, I don't see how useful the functions you propose are. Do >> you have a precise use case? > > Imprecisely, I suspect one might find such predicates useful when about to > choose between two methods of doing something: one which is quick, but only > works in the (common) simple case, and one which is general but slow. > Whether that happens frequently enough for them to be put in the kernel is > another matter. The approach I described with \tl_map_inline:nn and \prg_map_break: seems pretty much as fast as a hard-coded version. Alternatively, for an expandable version, you could use \cs_new:Npn \your_test:n #1 { \str_if_eq:nnT { bingo! } {#1} { \use_ii:nnn } } %.... \tl_map_function:NN \l_your_tl \your_test \use_ii:nn { True code } { False code } Of course, the non-expandable version is cleaner. But I somewhat doubt that people who really need the expandable version can't code that easily. Dunno. > sidetracked by other projects (in this case, actual research) Research does that to people :-). I'm off to work on my PhD for a short bit. Cheers, Bruno