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 q56M7boQ007592 for ; Thu, 7 Jun 2012 00:07:38 +0200 Received: (qmail 14204 invoked by alias); 6 Jun 2012 22:07:32 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 06 Jun 2012 22:07:32 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx064) with SMTP; 07 Jun 2012 00:07:32 +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 q56M4xYA004410 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Jun 2012 00:04:59 +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 q56M2wFG015934; Thu, 7 Jun 2012 00:04:58 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1988537 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Thu, 7 Jun 2012 00:04:56 +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 q56M4eer016744 for ; Thu, 7 Jun 2012 00:04:40 +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 q56M3ukh011450 for ; Thu, 7 Jun 2012 00:04:03 +0200 Received: from mittelbach-online.de (p4FEE4F5E.dip.t-dialin.net [79.238.79.94]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0MNRWv-1SeJ4n0FvF-0073Ip; Thu, 07 Jun 2012 00:03:56 +0200 Received: by mittelbach-online.de (Postfix, from userid 783) id 6045E1080323; Thu, 7 Jun 2012 00:03: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 AD1A1108031A for ; Thu, 7 Jun 2012 00:03: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 X-Antivirus: avast! (VPS 120606-1, 06.06.2012), Outbound message X-Antivirus-Status: Clean X-Provags-ID: V02:K0:HdW0eZTTafavJNzVoAoSdScB4E0HhPsgIIyth8FKLRI v0zIlrxQXzLv+EWwgkYkJ24LaWxLkZSGk0KdeBCkekpRRKPPqW SZM27XCMeQL+jVV8TO/Y0mybcx5coPtfnmlf7aMdJ8c257IVgb l/6hS5/lMTTf+PjAVtAECWrB1v2XRiDbt5b7D2mi/u4XkJ0k/e 5GHxi/OAqchpFBW9O8b2YsmXlIUfnyouED/2Dq8s5U0QMgmAvX 00SBkJLNOeVecA2jtD4GKYI9OHuH+LLn9mP6bRRXTZXBpT5M6P hQ8JlAP8cJnrVzXJZS5yrNEMXWEarUK2bHLt/7zU9enh5gb1Dn +P+hrmOkQHWUCi4bo7t1qo5F2dBGI1gKpBsYo6ZBZ Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id q56M4eer016745 Message-ID: <4FCFD3C5.5050309@latex-project.org> Date: Thu, 7 Jun 2012 00:03:49 +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=5D7Q89H36p6sJLDpZh614CxMiiOljKSnMVOJYSIvjjcIfFtTHBmSDsvKjtLLeHBBgWmwO Q5Cqy+DINjUxzYtcHrHeTGQWYVHhaSbYPeGU59XIGtQeErmTy1MIks/q9Rn2reVDsqOk+5YBbifr ljbil7Na9EgZurBQ6mUyvx/EADmh/GLdW4Miu4mz9OayGUyf3UFgM2q6zs=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: 7070 Am 06.06.2012 23:08, schrieb Lars Hellström: >> *Extending DocStrip* >> >> The 'two underscore' convention can of course be used directly in code. >> However, as it extends the name of every code-level name, this may not >> be desirable. To support this further, we have also explored the idea of >> extending DocStrip such that a 'marker' can be used for internal >> material, such that this can be replaced by the "__foo" part. >> >> The approach that we have taken for this is to use "@@" as the indicator >> for internal code: >> >> \@@_function:nn >> \l_@@_variable_tl >> >> To tell the extended l3docstrip program what is the appropriate >> replacement for "@@", an additional guard-like line is also required: >> >> %<@@=foo> >> \@@_function:nn % Will be converted to \__foo_function:nn >> \l_@@_variable_tl % Will be converted to \l__foo_variable_tl > > Are these examples exact or handwaved? It looks as though @@ magically > expands to either __foo or _foo depending on context! magic :-) The current implementation actually implements the following transformations while l3docstripping: __@@ -> __foo _@@ -> __foo @@ -> __foo in that order. The first one could probably be dropped. I asked for it because I thought initially that even with the @@ one might want to write \__@@_bar:nn to indicate an internal function in a dtx file. But using this the code reads well enough with just \@@_bar:nn So that one cuold probably be dropped, although it doesn't hurt. For variables \l_@@_bar_int just reads better than \l@@_bar_int which is why the second transformation is there. > >> %<@@=bar> >> \@@_function:nn % Will be converted to \__bar_function:nn >> >> %<@@=> >> \@@_function:nn % Will be extracted unchanged >> >> (It is important to note that this 'extended DocStrip' idea additional >> to the idea of an 'internal' syntax.) > > An interesting benefit of this could be that if one steals a bit of code > from some other package, then it will automatically be localised to > one's own namespace. It also allows you to directly execute the code even with @@ inside as long as you don't try to do this with more than one module name at the same time. For example I'm currently writing some code for a new module in a different window and write it directly into the .sty file and not bother about docstripping at all > On the other hand, I fear that you may be opening > up an avenue of feature creep here. If you introduce @@ today, then > someone will probably want @1@ and @2@ in a year or so. We intend to ship l3docstrip rather than extending docstrip.tex. I think such feature creep can be avoided. > Also, as someone who is heavily using, and even porting > (http://tcllib.sourceforge.net/doc/docstrip.html), docstrip with other > languages, I must say I am more than a bit worried by the idea of making > assignments to @@ part of the guard expression syntax; that feels like > extending them into something they're not supposed to be. open to debate I guess. What is important for me is that the transformation rule is part of the documentation which suggests some sort of guard notation. But yes, one could think about placing it in the docstrip.ins file instead. We started out with % but in the end the feeling was the simple <@@=foo> actually works better. Also my expectation is that you do not turn those things one and off (except perhaps in the kernel once the currently separated files are partly or fully joined together). So normally there will be a single line at the beginning stating the module name to be used in place of @@. > Other approaches I would find preferable to %<@@=foo> is to use %%% > lines (as an homage to mft) or explicit commands in the .ins file; after > all, most source files don't contain code for multiple l3-modules. To be honest I don't like that much but perhaps this is something one just needs getting used to. 'night frank