Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Tue, 25 Aug 2009 10:38:36 +0200 Received: by mail.proteosys.com (8.14.3/8.14.3) with ESMTP id n7P8cZP9005505 for ; Tue, 25 Aug 2009 10:38:36 +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 n7P8XFv4024973 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Aug 2009 10:33:15 +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 n7OM2RJM018349; Tue, 25 Aug 2009 10:33:12 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.5) with spool id 286699 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 25 Aug 2009 10:33:12 +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 n7P8XCIm026578 for ; Tue, 25 Aug 2009 10:33:12 +0200 Received: from rv-out-0708.google.com (rv-out-0708.google.com [209.85.198.240]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id n7P8X7eC028036 for ; Tue, 25 Aug 2009 10:33:11 +0200 Received: by rv-out-0708.google.com with SMTP id c5so968677rvf.2 for ; Tue, 25 Aug 2009 01:33:06 -0700 (PDT) Received: by 10.141.35.21 with SMTP id n21mr2584541rvj.86.1251189186335; Tue, 25 Aug 2009 01:33:06 -0700 (PDT) Received: from ?129.127.15.244? ([129.127.15.244]) by mx.google.com with ESMTPS id c20sm4077918rvf.10.2009.08.25.01.33.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 25 Aug 2009 01:33:05 -0700 (PDT) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) References: <4A7921CF.5020803@morningstar2.co.uk> <4A8EC449.4040509@morningstar2.co.uk> <19088.5371.517713.176151@morse.mittelbach-online.de> <19090.50621.179277.605279@morse.mittelbach-online.de> <09905C33-A148-40E5-A28F-0755ECD618AF@gmail.com> <19091.35422.30263.945137@morse.mittelbach-online.de> X-Mailer: Apple Mail (2.935.3) X-Spam-Whitelist: Message-ID: Date: Tue, 25 Aug 2009 18:03:00 +0930 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Will Robertson Subject: Re: xparse To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <19091.35422.30263.945137@morse.mittelbach-online.de> 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: 25 Aug 2009 08:38:36.0185 (UTC) FILETIME=[6FD54890:01CA255F] Status: R X-Status: X-Keywords: X-UID: 6004 On 25/08/2009, at 4:23 PM, Frank Mittelbach wrote: > I think some of the problem here lies in the fact that you all think > of xparse > as a bunch of TeX macros providing a single solution. Don't. *click* Aha! > This is why I would think that separating the two is key. There is > (and can > be) a single interface to declare a layer 0 command. And for each > such command > there is an interface declaration for each layer -1 (but how that > interface > decl is done might differ from layer -1 to layer -1). [...] > The big open question for me is to describe what the language at > layer 0 > really looks like. Now I understand you completely. (I hope.) We want to describe every document element in terms of a template instance. (I know you mentioned the other day that "template instance" isn't strictly true but I don't feel that the word "instance" on its own carries enough weight.) Using your example, an arbitrary section header becomes converted into \UseInstance {sectioning} {section} {#1} {#2} Correct me if I'm wrong: (a) The template type defines the mandatory number of arguments required by each instance (b) Each variation on a command (say, the different between \section and \section*) will be handled by a separate instance Isn't layer 0, in these terms, simply a list of template types and instances allowed in the document? ((Late addition: Now that I read over what I've written, I suppose that some sort of hierarchy could be imposed as well. That makes things more complicated.)) A description for layer 0 might then look (very hypothetically) like \begin{DefineClassTypes}{book3} \InheritTypes{ paragraph-shapes, cross-references, breqn-support, % I don't know what I'm writing here, really. % Just trying to imply that you might want to base classes off other classes % or based off simply functionality that belongs only in many classes. } \TemplateTypeWithInstances{sectioning}{ front-matter-division, chapter, appendix, numbered-section, unnumbered-section, % No other instances than these are allowed! % The instances themselves are defined in layer 1. } \TemplateTypeWithInstances{text-lists}{ itemize, enumerate, description, % Ditto. } \end{DefineClassTypes} * * * Any layer -1 interface would then provide tools to convert whatever input there is into instances defined as above. So, xparse2e would contain \DeclareDocumentCommand\section{som}{% \ifBoolean #1 { \UseInstance{sectioning}{numbered-section} {#2} {#3} }{ \UseInstance{sectioning}{unnumbered-section} {#2} {#3} } } I can't really see how this could be abstracted any more, but that might be a lack of imagination on my part. Must run, Will