Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id s3F9jsiA009336 for ; Tue, 15 Apr 2014 11:45:55 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx007) with ESMTPS (Nemesis) id 0MCxqV-1WjaKF1Xdr-009jPa for ; Tue, 15 Apr 2014 11:45:49 +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 s3F9gs3v007652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Apr 2014 11:42:54 +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 s3F9TYHo019913; Tue, 15 Apr 2014 11:42:53 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 10863544 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 15 Apr 2014 11:42:53 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s3F9gr84010072 for ; Tue, 15 Apr 2014 11:42:53 +0200 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.130]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id s3F9gZPD007538 for ; Tue, 15 Apr 2014 11:42:38 +0200 Received: from mittelbach-online.de (pD9FE2E7D.dip0.t-ipconnect.de [217.254.46.125]) by mrelayeu.kundenserver.de (node=mreue005) with ESMTP (Nemesis) id 0LodLS-1XBmPh2hvm-00gUDC; Tue, 15 Apr 2014 11:42:35 +0200 Received: from [192.168.123.105] (falco [192.168.123.105]) (Authenticated sender: frank) by mittelbach-online.de (Postfix) with ESMTPSA id 1FD22A0018 for ; Tue, 15 Apr 2014 11:41:22 +0200 (CEST) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 References: <534BE2F5.6020603@residenset.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-MailScanner-ID: 1FD22A0018.A76E8 X-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-MailScanner-From: frank.mittelbach@latex-project.org X-Spam-Status: No X-Provags-ID: V02:K0:wZQJJB/Rs6nZX+540wke/0vTRTqyEN8XoKFUB7/uRbQ c927Tkn80dTRfF9+eOKBzH+5kE6KloOsdmMRg0IPAixsNTBRKW /EA1Uqmy5vNwkVLBzgmFbRRHfnkGXJIuD8qZzmXTydWqH8YMHl tXmBmCRST4hvsr9NmM6fPGe79B9setYwfegOl+d0TfIa1grF24 y8o5w/bYGc3iUWzlk1RARRX1tFvf5VghLE4lwHIPftuSu9PEip eDwXDmlIKxUHpt8PpTqCmx2Y9P1j7ImVcO514PusBfSwLgiusg N59lNO2FFnd2fQmy5YLnXHE82a6/ufEoQPDcGZso9TH51wLAI1 /fCzkqpVU75OUSZ0PAzC9HdK6tzDfRHwh1JwOiL1JtifDT7l7y 4I0OdN67YV1BA== X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id s3F9gr84010073 Message-ID: <534CFEBD.9080307@latex-project.org> Date: Tue, 15 Apr 2014 11:41:17 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Frank Mittelbach Subject: Re: Variable functions, or function-valued variables To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <534BE2F5.6020603@residenset.net> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by relay.uni-heidelberg.de id s3F9gs3v007652 Envelope-To: X-GMX-Antispam: 0 (Mail was not recogn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HzGHWhVVr+ijWuxFyZM4lBURgcnVc8mHrsVz46tauglXM30X3apKr0 8VNJrFEGMmhLFfXY9krNLhAJ3Ltm1tDG8DvUen+H23e9fu1qAPGg6dOpW27Lz0orLOrMLZ5Fe V6/gvwdVPBYNn36jKOq5M725WJZwU+ksZKN7xlhPIEsSEvr+9AsdHW7sm88RDKaTiN/HAnRkP BgVGsbYaVrXwujEoY0jIo5ShsoXRWLwrpwb0gBWTpCegU3rNRtVW2EhydhQH6dEstrRcse6yT BKZUqmM8lFlExd7ZzJjvB0gULjoROqETOY+Wdgnbssd1guk+7lLngHnPxHXe4NyjiSLvNHQ9K L2rJ9UllJfnXkp58PFB1eLz4rl3tufubebtS8+onv5m3mtjWUUCEq+7OqbyrvMFf7dhDQ326J 6Q+H5lUc8WCq8uoyhWAYhVY//gDngVxACOlRg2qveppb8ZfqF0oCQqpyVVwQwZ/1yHv2IAEbw 2uaNz7mQ== X-UI-Loop:V01:AqCpPjdgNoQ=:xziNqgUvQb71Dj4olW2ry7MoU24woCReF11KqLhgnK0= Status: R X-Status: X-Keywords: X-UID: 7369 Am 14.04.2014 15:30, schrieb Lars Hellstr=F6m: > The typical example of this would be a callback function: something > that a module calls at specified points, but which the user of that > module is expected to define. Treating this as just a function loses > the specification of the scope for that variable. Treating it as a > variable of type tl loses the specification that it takes arguments. > What I found natural is to use a name of the form > > \__: > > e.g. > > \l_harmless_callback:nn > > This could be interpreted both as adding a SCOPE part to function > names (the vast majority of functions without a SCOPE are implicity > considered to be c_ constant), or alternatively as proclaiming any > : to be a valid _ for a variable. that's an interesting point. I'm a little torn over this to be honest. On one hand I rather like the idea to mark functions that are supposed to be defined/manipulated by a user of a package specifically but on the the other hand I'm not so sure the suggested convention would work nicely in practice as it blurs the distinction between traditional "data" variables a bit and I'm not sure how that would work out (though=20 that is something to experiment with I guess). if that suggestion is taken up then \__: with _ being either l_ or g_ sounds fine (the majority of=20 functions are supposed to be constant so c_ should definitely implicit=20 in my opinion) also \l__ or \g__ should never been allowed as module internal=20 functions by definition should not be a user or programmer outside the=20 package. One question to keep in mind though is do we really would see both l_=20 and g_? r would we see many of them at all? If a package expects a=20 number of such "variable functions" to be set up before some of its=20 interfaces can be used then you have the issues of state/scope to deal=20 with and the fact that such a package could be used by several other=20 packages etc. In that case I wonder if it wouldn't be better to=20 encapsulate the setup by providing a setup function and use an internal=20 function for the "variable function" (in which case the direction would=20 then be somewhat opposite, ie we would suggest to use \l_@@ and \g_@@=20 for the variable functions and the setup function would become an=20 unchangeable constant function taking code as arguments Speaking of "user": we are talking here "user" as in programmer of some=20 other package using the former one, not end user using document level=20 customizations. Because for those I would maintain that no expl syntax=20 should leak and any such customizable function would need to be=20 encapsulated by a proper interface - at least this is my take on this cheers frank