Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id pB4KIqsb017890 for ; Sun, 4 Dec 2011 21:18:53 +0100 Received: (qmail 25806 invoked by alias); 4 Dec 2011 20:18:47 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 04 Dec 2011 20:18:47 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx054) with SMTP; 04 Dec 2011 21:18:47 +0100 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 pB4KGP00032325 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 4 Dec 2011 21:16:26 +0100 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 pB3N166S010506; Sun, 4 Dec 2011 21:16:25 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1927437 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sun, 4 Dec 2011 21:16:25 +0100 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 pB4KGPuP013671 for ; Sun, 4 Dec 2011 21:16:25 +0100 Received: from mail-lpp01m010-f49.google.com (mail-lpp01m010-f49.google.com [209.85.215.49]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id pB4KGKOq011578 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Sun, 4 Dec 2011 21:16:24 +0100 Received: by laai10 with SMTP id i10so1184740laa.22 for ; Sun, 04 Dec 2011 12:16:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.152.106.115 with SMTP id gt19mr4225727lab.27.1323029780466; Sun, 04 Dec 2011 12:16:20 -0800 (PST) Received: by 10.152.18.229 with HTTP; Sun, 4 Dec 2011 12:16:20 -0800 (PST) References: <4ED9ED20.40004@morningstar2.co.uk> <4EDA0732.5060003@latex-project.org> <4EDB8079.6000707@morningstar2.co.uk> Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Whitelist: Message-ID: Date: Sun, 4 Dec 2011 15:16:20 -0500 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: Documentation of local/global variants To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <4EDB8079.6000707@morningstar2.co.uk> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (BackTrace mail analyze); Detail=5D7Q89H36p4L00VTXC6D4q0N+AH0PUCnGL2vqOgpaBYL16oitsMrgDt/NQNpSCZFFjDOy 97xb7Zpf+wZnd5ZXNcvLDXR3Wg3wRjdQbwEMh8=V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 6971 On 12/4/11, Joseph Wright wrote: > On 03/12/2011 11:25, Frank Mittelbach wrote: >> Am 03.12.2011 10:34, schrieb Joseph Wright: >> >>> I wonder if it would make more sense to take the same approach for >>> functions with local/global versions. Something like: >>> >>> 'Where functions for variable manipulation can apply either locally or >>> globally, the latter case is indicated by the inclusion of a "g" in the >>> last part of the function name. Thus \tl_set:Nn is a local function but >>> \tl_gset:Nn acts globally. Functions of this type are always documented >>> together, and the scope of action may therefore be inferred from the >>> presence or absence of a "g".' >>> >>> The scope would then be excluded from the function documentation: >>> >>> % \begin{function} >>> % { >>> % \tl_set:Nn, \tl_set:cn, >>> % \tl_gset:Nn, \tl_gset:cn >>> % } >>> % \begin{syntax} >>> % \cs{tl_set:Nn} \meta{tl~var} \Arg{tokens} >>> % \end{syntax} >>> % Sets \meta{tl~var} to contain \meta{tokens}, >>> % removing any previous content from the variable. >>> % \end{function} >>> >>> Does this make sense as a sensible balance between formality and >>> documentation length? >> >> I would be quite happy with this approach of documenting local and >> global variants in a single place together as the convention is in >> nearly all cases very clear and the use of "g" or its absence >> understandable without further explanation (other than at the very >> beginning outlining the approach). And in the few cases where the "g" >> may need additional explanation because it could refer to one or the >> other argument that could still either be done on the spot or if >> necessary in that case split into separate documentation blocks. > > Yes, there are a few cases where such a convention would not be > sufficient, for example \prop_(g)get:NnN. As I said, this mirrors the > situation with TF functions, where there are a few in which the > documentation does have to cover more complex situations on a > case-by-case basis. Side note: \prop_gget:NnN doesn't and shouldn't exist. We may want to add somewhere a mention that 'pop' and 'gpop' functions always return their value locally. I agree on having a general statement about local and global assignments, since there are very few cases where it does not apply. However, the "g" is not in the last part but in the second part (\tl_gput_right:Nn, \char_gset_catcode_group_begin:N). Also, I'd prefer something a little bit more specific than "can apply", replaced below by "perform assignments", I think that this is the only situation in which there is such local versus global functions. = Where functions for variable manipulation can [perform assignments] either locally or globally, the latter case is indicated by the inclusion of a "g" in the [second part] of the function name. Thus \tl_set:Nn is a local function but \tl_gset:Nn acts globally. Functions of this type are always documented together, and the scope of action may therefore be inferred from the presence or absence of a "g". = Regards, Bruno