Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id s7UMtaSD025649 for ; Sun, 31 Aug 2014 00:55:37 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx012) with ESMTPS (Nemesis) id 0LjMqt-1Y0E732QgB-00db1Y for ; Sun, 31 Aug 2014 00:55:30 +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 s7UMqr2Q031384 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 31 Aug 2014 00:52:53 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s7UM147k001982; Sun, 31 Aug 2014 00:52:53 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 11284153 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sun, 31 Aug 2014 00:52:53 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s7UMqr7X004841 for ; Sun, 31 Aug 2014 00:52:53 +0200 Received: from homiemail-a16.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s7UMqfBc026166 for ; Sun, 31 Aug 2014 00:52:44 +0200 Received: from homiemail-a16.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a16.g.dreamhost.com (Postfix) with ESMTP id 4E2A8508072 for ; Sat, 30 Aug 2014 15:52:41 -0700 (PDT) Received: from smbp.home.seanallred.com (pool-108-51-157-100.washdc.fios.verizon.net [108.51.157.100]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: tex@seanallred.com) by homiemail-a16.g.dreamhost.com (Postfix) with ESMTPSA id 11F2E508064 for ; Sat, 30 Aug 2014 15:52:40 -0700 (PDT) References: <53F667E1.8080909@morningstar2.co.uk> <5B8B103B-5CCD-490E-9177-F1B8F65C26BF@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) MIME-Version: 1.0 Content-Type: text/plain Message-ID: Date: Sat, 30 Aug 2014 18:52:39 -0400 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Sean Allred Subject: Re: Thoughts on xtemplate To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <5B8B103B-5CCD-490E-9177-F1B8F65C26BF@gmail.com> (Will Robertson's message of "Sun, 24 Aug 2014 11:23:25 +0930") Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:c+WCJgiPGU4=:CQQ7q+t3Ngn5Ns2JbHhE8/1tVX iyznHvpHny0y1Ccy7Qf1FytIC1v1cNve71qP6HQe0tCcMcJpCAS52MWdouxue0aBNUlDOv0Vq vyeKs1e9IlXB+k8wykTm2xA0PpQmcobAIx598AYhvz1JSPwR8qeWss9VOQAcwh1kcia0ZOo0G RRvGjiAmmUwOAEhHD89QdVWUMYXJy+XjqC6S+8D6FQWdRRsxqH7Fkpr9D+EDMkcJyZcXVg8+R jt5D7dIXlESKI2QObgJqfVwhTcMDd8l4v9Y6Mlc3fTW0EQs5ONNiUABpBt8zeSwkwY6lQAogj QUKZyjSBFxtipi/GIFX2qwjP0qcWxYcEh7Eq3UdpZZ1sr7ySPkpKidT6IPrE4flII3BNYStd0 zwe4qv4ed9B4RMylFrfYJTeYiXQRZwTJVzyNC6Y/UApfjb1P0tDyzLb0s2ZxN9+mZSgSMpRm0 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uys2pR/YaxaAiCOx+ZyHYMIKD6TKU4sStk51i8Q= = X-UI-Loop:V01:A0lgqddPebk=:gmD0K9g9VQHVRksnYtC5T4OQWi4p7feUEVIzIK855iE= X-UI-Out-Filterresults: notjunk:1; Status: R X-Status: X-Keywords: X-UID: 7577 > On the other hand I do see Joseph's point that when you have just one > or two actually mandatory arguments that writing the following is a > bit ugly: > > \UseInstance{crossref}{latex2e}{ label = #1 } That's a fair point, but I would raise that this case is duplicated in other style languages. In CSS, we favor consistent syntax over ease of use: pre .tex-comment { color: #BBB; } vs. the TeX-style pre .tex-comment #BBB simply because the extension of this pattern yields confusing specifications: pre .tex-comment { color: #BBB; font-weight: bold; some: made-up; properties: for-the; purpose-of: example; } would necessarily become pre .tex-comment #BBB bold made-up for-the example; When you think about it, it's not that extreme of an example. Like templates, style sheets are written once and used many times over. Clear definitions in the language are preferred over better pars in code golf. While it's awkward in the single-property case, the consistency is worth it. In the end, it's less for a new user to learn. I'll take a stab at my own argument and say that, in the case of CSS, *everything* is optional, so it's a poor choice for an example. I hope that this doesn't detract from what I'm trying to say, though :) > So according to the situation you could have either > > \UseInstance{...}{...}{arg one}{arg two}{arg three} > > or > > \UseInstance{...}{...}{ arg-one=... , arg-two=..., arg-three=... } > > or even a combination of the two: > > \UseInstance{...}{...}{arg one}{ arg-two=..., arg-three=... } Were you able to take a peek at the proposal document I sent out? https://gist.github.com/vermiculus/d8ac080f3f8c7ec2bed6#file-idea-org Given the limitations of purely positional arguments, I feel that I make a pretty good case for keyval-based arguments. Presuming the arguments against positional arguments are persuasive, the language impurity introduced by the hybrid option doesn't sit well with me. If I were a new user to the system, I would be confused that I could name some arguments but I wasn't able to name the positional ones. It just feels... wrong :). To clip a bit from the above-mentioned proposal, something like this seems most inline with the existing paradigm: \DeclareObjectType { name } { first : tokenlist , middle : tokenlist , last : tokenlist , first : .required , last : .required , } or the more concise \DeclareObjectType { name } { first : tokenlist! , % bang => required middle : tokenlist , % no bang => optional last : tokenlist! , } A case that I just thought of is the case of dependent arguments --- those arguments that are optional, but require an additional piece of (normally optional) data to be used, such as `epithet` and `epither-credit`, for example. Perhaps something like \DeclareObjectType { chapter } { title : tokenlist! , epigraph : tokenlist , epigraph-credit : tokenlist!(epigraph) , } or \DeclareObjectType { chapter } { title : tokenlist , title : .required , epigraph : tokenlist , epigraph-credit : tokenlist , epigraph-credit : .requires epigraph , } All the best, Sean