Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Fri, 23 Oct 2009 15:28:09 +0200 Received: by mail.proteosys.com (8.14.3/8.14.3) with ESMTP id n9NDS8ie011977 for ; Fri, 23 Oct 2009 15:28:08 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id n9NDO8Gb001075 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Oct 2009 15:24:08 +0200 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 n9NAeWFb000756; Fri, 23 Oct 2009 15:24:02 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.5) with spool id 344871 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 23 Oct 2009 15:24:02 +0200 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 n9NDO2Ye018637 for ; Fri, 23 Oct 2009 15:24:02 +0200 Received: from ueamailgate02.uea.ac.uk (ueamailgate02.uea.ac.uk [139.222.131.185]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id n9NDNkhF031833 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 23 Oct 2009 15:23:49 +0200 Received: from ueams01.uea.ac.uk (ueams01.uea.ac.uk [139.222.131.78]) by ueamailgate02.uea.ac.uk (8.13.1/8.13.1) with ESMTP id n9NDNjT3001442 for ; Fri, 23 Oct 2009 14:23:45 +0100 Received: from [139.222.200.104] by ueams01.uea.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1N1K7N-0008VT-IW for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 23 Oct 2009 14:23:45 +0100 User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 References: <4AE0BFB3.7080905@morningstar2.co.uk> <8A015AE0-022B-4462-B8D5-CC1010E49205@gmail.com> <4AE18854.7080704@residenset.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Canit-CHI2: 0.08 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN, outgoing) X-CanItPRO-Stream: UEA:outgoing (inherits from UEA:default,base:default) X-Canit-Stats-ID: 33817473 - fbcd681ab942 X-Scanned-By: MIMEDefang 2.65 on 213.139.130.197 X-Scanned-By: CanIt (www . roaringpenguin . com) on 139.222.131.185 Message-ID: <4AE1AE63.2000000@morningstar2.co.uk> Date: Fri, 23 Oct 2009 14:23:47 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: xparse processors To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <4AE18854.7080704@residenset.net> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-ProteoSys-SPAM-Score: -6.599 () BAYES_00,RCVD_IN_DNSWL_MED Return-Path: owner-latex-l@LISTSERV.UNI-HEIDELBERG.DE X-OriginalArrivalTime: 23 Oct 2009 13:28:09.0789 (UTC) FILETIME=[A9AE1ED0:01CA53E4] Status: R X-Status: X-Keywords: X-UID: 6112 Lars Hellström wrote: > From my point of view, there were two issues. > > The first issue is that the given "return value register" > \l_xparse_arg_toks is a toks when (in my experience) values (at least > non-numeric values) are more commonly returned by defining a macro. This > thus has to do with the ability to reuse existing code (in packages and > such). Yes, I can certainly see that point. > The second issue is that the name \l_xparse_arg_toks would not fit in at > all if using \DeclareDocumentCommand in e.g. the preamble of a document; > one would have to fiddle around with the catcodes just to be able to > type it, and the name is unintuitive. I'd tend to regard processing an argument as something that is going to show up mainly in blocks of code, not ad hoc definitions for functions in a document. However, we loose nothing by allowing some flexibility. > I suppose a compromise could be to use a fixed command name in the same > class as \DeclareDocumentCommand -- e.g. \XparseResult or > \XparseProcessorResult -- and do > > \let\XparseResult=\l_xparse_arg_toks > > just before each processor; then the user can use this high-level name > and not have to worry about the low-level LaTeX3 name. Furthermore this > provides support for mixing macro- and toks-setting processors, as code > that ends up doing \XparseResult={...} will access the toks register, > whereas code that ends up doing \def\XparseResult{...} just breaks the > association of \XparseResult to \l_xparse_arg_toks (as opposed to > breaking xparse as a whole). Either way, V-expanding \XparseResult will > recover what had been stored. Taking this idea, I'd probably favour something that doesn't include "xparse" as a document-level function: perhaps \ProcessedArgument or \ProcessingResult? If I say that it will initially be a toks (for each parsing run), then you can do \let\ProcessingResult\YourMacro \def\ProcessingResult{whtever} \toks_set:NV\ProcessingResult\Variable etc. Would that work? -- Joseph Wright