Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Thu, 3 Sep 2009 14:44:58 +0200 Received: by mail.proteosys.com (8.14.3/8.14.3) with ESMTP id n83Ciw5n011026 for ; Thu, 3 Sep 2009 14:44:58 +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 n83CeDLM008813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 3 Sep 2009 14:40:13 +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 n83AJirN027151; Thu, 3 Sep 2009 14:39:59 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.5) with spool id 304967 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Thu, 3 Sep 2009 14:39:59 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id n83CdxDs005127 for ; Thu, 3 Sep 2009 14:39:59 +0200 Received: from mail.umu.se (jazz.umdac.umu.se [130.239.8.31]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id n83Cdg5O008214 for ; Thu, 3 Sep 2009 14:39:45 +0200 Received: from hexley.local ([130.239.119.186]) by mail.umu.se (8.13.6/8.13.1) with ESMTP id n83CdamW024280 for ; Thu, 3 Sep 2009 14:39:41 +0200 (MEST) User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 References: <4A7921CF.5020803@morningstar2.co.uk> <4A86949D.3090500@morningstar2.co.uk> <4A886BA8.2000209@morningstar2.co.uk> <0417DF73-EC19-4262-B9DF-5C870D47BFCE@gmail.com> <4A893816.2090807@residenset.net> <4A89610D.8060108@morningstar2.co.uk> <4A8C71CC.7000006@residenset.net> <4A8D0048.4070101@morningstar2.co.uk> <4A946AD7.4020506@residenset.net> <4A9EC61D.5000502@morningstar2.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id n83CdxDs005128 Message-ID: <4A9FB9E7.40902@residenset.net> Date: Thu, 3 Sep 2009 14:43:19 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: =?ISO-8859-1?Q?Lars_Hellstr=F6m?= Subject: Re: xparse To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <4A9EC61D.5000502@morningstar2.co.uk> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-ProteoSys-SPAM-Score: -6.599 () BAYES_00,RCVD_IN_DNSWL_MED X-Scanned-By: MIMEDefang 2.65 on 213.139.130.197 Return-Path: owner-latex-l@LISTSERV.UNI-HEIDELBERG.DE X-OriginalArrivalTime: 03 Sep 2009 12:44:58.0361 (UTC) FILETIME=[586A1690:01CA2C94] Status: R X-Status: X-Keywords: X-UID: 6084 Joseph Wright skrev: > Lars Hellström wrote: >> Finally, there is the issue that a processor has to put the argument in >> a toks register. I understand this is for generality (only sane way to >> pass along # tokens), but my experience with this type of API is that >> one should make it easy to use commands that happen to already exist. In >> this case, it would mean to also support a processor that would store >> its result in a macro rather than a toks register, since I'm quite sure >> this is what people tend to do unless they definitely need a toks register. > > Maybe I'm missing something here, but if we need the processed value > returned in a named variable it should not matter whether it is a toks > or a tl (or indeed anything else). The point is that when specifying a processor, it's kind of a drag having to introduce a helper function just for the purpose of glueing xparse's syntax to that of an existing command really implementing the operation; it would be much better if the syntaxes fitted from the start. For operations that produce a sequence of tokens as result, I believe the most common syntax would be the same as for \MakeHarmless, i.e., \MakeHarmless{} (other examples more or less matching that syntax are \def and \edef). Token registers, in my experience, is something you avoid using as variables unless you have a specific need for them. > All that needs to happen is > > \toks_set:NV \l_xparse_arg_toks > > which is the same action if is a tl or a > toks. Yes, but it is awkward to put that piece of code in the >{...} modifier, since it must be executed *after* the actual processing step has been carried out -- it pretty much requires a helper function to rearrange things. Hence my suggestion that /xparse/ should supply that piece of code, rather than rely on the user to do it. Actually, a thing that worries me about the >{} syntax discussed so far is that it presumes the programmer doing \DeclareDocumentCommand has \ExplSyntaxOn, which I don't think is a safe bet; we're talking about something which is somewhat like \newcommand. A better syntax might be >{}{} with the semantics that xparse will execute {} and expects to afterwards find the result in the ,[*] which it can then transfer to \l_xparse_arg_toks or perhaps pass directly to the next processor. This adds the ability to use processors that leave their result in a fixed place, but more importantly it avoid tying the argspec syntax to implementation details of xparse. [*] Okay, here that automagic "V" expansion type actually turns out to be useful. :-o Lars Hellström