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 q56LdXcR028209 for ; Wed, 6 Jun 2012 23:39:34 +0200 Received: (qmail 26008 invoked by alias); 6 Jun 2012 21:39:28 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 06 Jun 2012 21:39:28 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx070) with SMTP; 06 Jun 2012 23:39:28 +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 q56LbCET029359 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Jun 2012 23:37:12 +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 q56G5Lj0031979; Wed, 6 Jun 2012 23:37:11 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 2049568 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 6 Jun 2012 23:37:11 +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 q56LbBxD012342 for ; Wed, 6 Jun 2012 23:37:11 +0200 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id q56Laxik005205 for ; Wed, 6 Jun 2012 23:37:04 +0200 Received: from mittelbach-online.de (p4FEE4F5E.dip.t-dialin.net [79.238.79.94]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0MSYbs-1SSRjC3l36-00RnaC; Wed, 06 Jun 2012 23:36:59 +0200 Received: by mittelbach-online.de (Postfix, from userid 783) id C0841108031B; Wed, 6 Jun 2012 23:36:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on Marlowe X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED,AWL autolearn=unavailable version=3.2.5 Received: from [127.0.0.1] (unknown [192.168.123.100]) (Authenticated sender: frank) by mittelbach-online.de (Postfix) with ESMTPSA id D4D401080317 for ; Wed, 6 Jun 2012 23:36:53 +0200 (CEST) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 References: <4FCE2B42.2090006@morningstar2.co.uk> <4FCFC6D7.20806@residenset.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 120606-1, 06.06.2012), Outbound message X-Antivirus-Status: Clean X-Provags-ID: V02:K0:q53I81y8VRcSpwF7RuNLC8qSOer8CFr/djpriB9VhTX sfWsePnbtB9s1w7dSluhFAla94UaT/yer1NZtNzPnDadrc0C3p W08I+5Myrw4TNSJjuSpQhLt4gU5t9Ud90xvFWowMRaHdJZRo4D 55hyMoBFxwoqtSTxImiUFJXjYR3jNha7fvDcxb3pOfWUWz9OHp IIUmfbqzMoyX1hkmJXAgzCFBy7UJ/hznjU7frN/zU9s8S2ELNX XxJz1Lr0ZcgdQh8tzCNgQ8YijV3egSIzpgj4ZCBXcpgMxt3Tew gTuerxn9N6/Vsx7G+x1CLPbQjhA9lR8B/gAWwGECxeZScSNILc qz72ewVYcseVjYn+Pa8gOLuPrtUTNvwjVuI3jXOwB Message-ID: <4FCFCD74.8090507@latex-project.org> Date: Wed, 6 Jun 2012 23:36:52 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Frank Mittelbach Subject: Re: Separating out 'public' and 'internal' functions/variables in LaTeX3 modules To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <4FCFC6D7.20806@residenset.net> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (eXpurgate); Detail=5D7Q89H36p6sJLDpZh614Kjz2nt6F3tHPcDbH05jgMoNnbqOj6VMg0Gx3bydF0qxmzvZi VAJymOddcSkpv1CUIpdnk4wbPlS8+r3czwkJKAA11cIUDVILTX62kvDsNeZzhNXm1lSnXYPfvUBB znYO3SBGFnGsfI5BUt3PZseECy18wWB+4c/pYcp8DT/VGKYFCa8AeYGHCg=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: 7069 Hi Lars > Joseph Wright skrev 2012-06-05 17.52: >> *An additional syntax convention* >> >> What the team feel may be needed is a way to enable LaTeX3 programmers >> to see which functions they are 'allowed' to use from other modules with > > Should that "with" have been "without"? > >> having to refer at all stages to the documentation. yes that should read "without". >> That does not of >> course mean that the documentation should not be written, but that we >> are looking for additional steps and support for good practice. > > There is a sort of contradiction here: how can a programmer sensibly > make use of a function from another module, unless they consult the > documentation on it to see what it does? So how can there be a problem > in the first place? There is no contradiction. People in the TeX world are used to just looking at .sty file and modifying and reusing them. As a result there are probably not many macros in the LaTeX kernel that aren't used somewhere in somebody's code. As a result you can't change/fix anything without breaking somebody's code. In many cases this was a necessity in LaTeX2e but often it was just bad style because there was no guidance and because using \@item rather than \item when you know you have a [ following saves you one expansion ... (certainly important in the early days) But now it means that one couldn't replace the internal implementation of \item without keeping \@item around or break all kind of packages. That's what this proposal is trying to achieve. We already did this "half-heartily" by having some functions ending in _aux but this didn't really work well because it makes the names long so many internal functions ended up just having normal names again. > Well, presumably because the LaTeX tradition has long been to RTFS > whenever the documentation fails to provide one with an answer, and to > consider everything reasonably stable as fair game for hacking. What you > seek to do is have some sort of convention that would make code that > violates the module boundaries scream out about this to the knowledgable > reader. Neither more nor less than that, am I right? yes. > >> Marking material as 'internal' to a module can be done by picking some >> naming convention which shows this is the case. The team have discussed >> a number of possible approaches, bearing in mind the fact that LaTeX3 >> code is in use and that it is therefore important not to make any >> breaking changes in this regard. The convention we propose is use two >> "_" at the beginning of the module to indicate internal material: >> >> % Public >> \foo_function:nn >> \l_foo_variable_tl >> >> % Internal >> \__foo_function:nn >> \l__foo_variable_tl > > Two things come to mind about this: > > 1. Double underscores, to me, suggests "compiler/vendor defined" rather > than "internal", which is definitely not the signal you want to send. > What alternatives have been discussed? One that could be used is that > Uppercase signals private, i.e. > > \foo_Function:nn > \l_foo_Variable:nn Yes we did and played with it. Camel case is not working well (for me at least). Given that we already use underscore a single one in front is not making a good mark and I don't think that the "compiler/vendor defined" signal is an issue. > 2. The default that the suggested convention would choose is that of > "public"; one would have to make an extra effort to mark something as > private. While public may be the more common case in several of the more > basic core modules, I very much doubt it would be so in higher level > LaTeX3 programming. This is true, but not so bad (imho) and it completely goes away if you use the suggested docstrip approach. cheers frank