Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Wed, 2 Sep 2009 10:28:22 +0200 Received: by mail.proteosys.com (8.14.3/8.14.3) with ESMTP id n828SLWJ006138 for ; Wed, 2 Sep 2009 10:28:22 +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 n828OJxP016695 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 2 Sep 2009 10:24:19 +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 n81M1J6V000417; Wed, 2 Sep 2009 10:24:13 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.5) with spool id 294917 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 2 Sep 2009 10:24:13 +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 n828ODjT013695 for ; Wed, 2 Sep 2009 10:24:13 +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 n828NvkS016110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 2 Sep 2009 10:24:01 +0200 Received: from ueams02.uea.ac.uk (ueams02.uea.ac.uk [139.222.131.131]) by ueamailgate02.uea.ac.uk (8.13.1/8.13.1) with ESMTP id n828Nvis021825 for ; Wed, 2 Sep 2009 09:23:57 +0100 Received: from [139.222.114.191] by ueams02.uea.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1Mil8F-0004jJ-14 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 02 Sep 2009 09:23:55 +0100 User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 References: <122D1D66-1300-424C-9FBC-11C0B0CCB6C9@gmail.com> <4A9517EA.208@residenset.net> <7FF23F49-785D-444F-94E0-28498B035A60@gmail.com> <4A97D80A.4000602@residenset.net> <19101.37807.165630.222380@morse.mittelbach-online.de> <4A9E229C.1070709@morningstar2.co.uk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Canit-CHI2: 0.00 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: 29517212 - c4e98ba4d882 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: <4A9E2BA9.6030505@morningstar2.co.uk> Date: Wed, 2 Sep 2009 09:24:09 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: template vs template-alt To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <4A9E229C.1070709@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 Return-Path: owner-latex-l@LISTSERV.UNI-HEIDELBERG.DE X-OriginalArrivalTime: 02 Sep 2009 08:28:22.0779 (UTC) FILETIME=[5584F4B0:01CA2BA7] Status: R X-Status: X-Keywords: X-UID: 6067 Joseph Wright wrote: > above-skip .skip_set:Nn = \caption_above_skip {0pt} , > number-format .func_2_args:Nn = \caption_number_format:nn {#1~#2:~}, Thinking about this some more, I feel I've missed a few important points: - templates always require the keys given to have values, so .value_required:/.value_forbidden: are not relevant. - multiple choices for templates should really be calls to instances of other templates. For example, if I have a key "alignment" which I expect to take values left, centre, center and right, then I should probably implement it as a call to look for an appropriately-named instance of some more basic template. So multiple choice keys are probably not that important for template. So taking Lars point about local definitions, and Frank's about self documentation, how about taking the current template approach and making it slightly more readable above-skip = \length \caption_above_skip {0pt} , number-format = \function 2 \caption_number_format:nn {#1~#2:~}, where we don't even need to define \skip, \function, etc., but just use the fact that they are picked up as single tokens by TeX. I think this is quite "self documenting" and shows the logic of what is being defined quite well. I've assumed that my earlier point about not having any optional arguments is agreed with here, but I'd hope that I've made a good enough case. (I should add that the l3keys approach is probably right for what it does, as there keys can have different properties set and may need to be set up with more than item given for a particular key.) -- Joseph Wright