Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by h2774747.stratoserver.net (8.15.2/8.15.2/Debian-3) with ESMTP id x1R5PmAO010620 for ; Wed, 27 Feb 2019 06:25:50 +0100 Received: from relay2.uni-heidelberg.de ([129.206.119.212]) by mx-ha.gmx.net (mxgmx117 [212.227.17.5]) with ESMTP (Nemesis) id 1MgwWT-1hV94M1aw9-00hLfR for ; Wed, 27 Feb 2019 06:25:43 +0100 IronPort-SDR: zsIWfmcg/uaIaytlzeGpsVTzrCtXzy2ZVT9RUxCljxdUYn+pJX6tTa5OEL5EifYFIg3qp9bC8K Y1GJubT9F4v8X/BXwyy06QEXf8ZHcuEBk0pMOKgwheXUORR1tzb7Qc+tzA/Lm2GAe3oYEC/jJ2 882gqXo/xrB0od+9WtztLjTyodSpWyR9ASwGsm9AMalt8znFQR0BxJB0Z98qn1ZNSQRf6FKItb nx/VXctqtNFDCto2xtPjUxYmWmJzH0XMLAR07SosJt5Jq0dneP5nl7yjMZpA5uniYLzs3rCWvL 7f4= Received: from listserv.uni-heidelberg.de ([129.206.100.94]) by relay2.uni-heidelberg.de with ESMTP; 27 Feb 2019 06:25:43 +0100 Received: from listserv (localhost [127.0.0.1]) by listserv.uni-heidelberg.de (Postfix) with ESMTP id EB1881275DE; Wed, 27 Feb 2019 06:25:36 +0100 (CET) Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 33801623 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 27 Feb 2019 06:25:36 +0100 Delivered-To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE Received: from listserv (localhost [127.0.0.1]) by listserv.uni-heidelberg.de (Postfix) with ESMTP id C5BD91275C4 for ; Wed, 27 Feb 2019 06:25:36 +0100 (CET) Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Message-ID: <6944820674077326.WA.kellysmith12.21gmail.com@listserv.uni-heidelberg.de> Date: Wed, 27 Feb 2019 06:25:36 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Kelly Smith Subject: Re: Templates and Variable Reuse To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE 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-Spam-Flag: NO X-UI-Filterresults: notjunk:1;V03:K0:1qYbMct5sf0=:IBnekLj+pzQNkToV+qrtUoDes4 12/rV7OU6rbY+ODmu92L3cQ2H3yCx8jMrGbgGBQjvPFqN3+F4q5DasUMo8ZbY8sWMu5BLEGwM 3xIGaVclyrm/iT3/LRpDBJ42egfTDXQVGHaXtYoRswaf3Pps1cYUFT5u9tb1Jx0sgCNdjLO1P wfR8AhZE86RBdTHXrWygK45VSRucFWMDholaUwolUkZL/WvEMbkr2+ba7K1BTr3g7JEVlMYJB RYqrxWks6DOgs1XSwYTxdgdPFjnMbj0T97FH/SypTYba+ivSAs3SOTxTeeU3BpLREOVWWaVcl JndvwZXZdG2sqCYTOTpD96EwhoTVNfvoOzCC31XHiWDPvP3QSpzpDS/JuJvhTfJErtdBtM7xq 1/IxgXkZYjWGScpdjT6NUIPueSyuhnRkpWPBP6sD98O+Jm3SJND95ZmLlKCZFL+42vAV8cGlr T72+XyNEHHN3quaCRDpl246VPHqSmNVgu2ES2doO/ktTo1yF9R4myVn3K0JI/XLRewVIzbKMK jrtas08PcV8nTe2EhqgGATTBwbvCfGODbuW6jMo6IR9AB/MefYTvqK3FR1YsxaNKVod51W451 t8HMF7VOkuRmWyRwTFSBMML+vCUlF+4ucLTJVQngk9ZdypXDp4HDoGwi7Zjz8GO20S35my4VZ eEbykKjgcqv3jk+m2CeIF2/5YfTt4Kw2f5jbgec0lJCKHlpIQlAfJJ+KVS0xw8gz5InA2No5U feu4RzpDmSmdWHMwt7BoCQiohwywqIU+npAqaWbLkDdg5rWj71p/JNKZBf2xsYZn1567Cr3uB uFwu64shJR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UnanhblqcqK8xthMoPOAqqtzpR+k513IvrPoFaaUN+IJHDBLoHL13UT2pJvSLjDqN2CME385 a+Jfq4mGAXx8EWKdAtKIyGE2DE3cav89PkWW9Q+VCL06tWh+FEzocrf8yTowzDgIgGlMpig0I vwq0Mq6mkHsyfk3yoPAb00Q8DJtjpfHoXk0nCWadeC3SC1L8sK3F1LytFDEOxr2fseh90WDjz I8sHyUo7BjhKT/2rwD07+xwFB31y9Nmv+B7xC5n2Dm8MjFIeWswdtDQ== X-UI-Loop:V01:6wFEpl1CmxY=:7Y6X9MKCkA9k16Nz0vPGZczknm+0/W42zdGXp0jc8ZI= X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:C74qEE5Nh2E=:wYSFoOn3dwKKEVUlfaZfy1 V8z5XWb71mGosGKRVoxE/tsgFUsSLlpA5Tde4dbu5TPVdVuipbhaE/di4wCkDI0F0O6/BLC8k ZlCM4DwU5g1ABc8nqN0AtuldrWF6pf+H80twyjXGDeKEqEsW2D9FIH5sxM5w3txLD+gQjEyO5 tOOnI9hxAQP8xnX7CjuBAI64lo+ejCqUK7bgW81u/cwBKlCh81I2wEBsOGYKNHcNkB7NNeDf3 ABtnE5JEPfFbmMfir6V6j5NUTxwxL+rZ0+ZbJzrYePheqH1ev/YYvSDpPRmM/vtgD8n9cZRMs lLjDdo25TRRYzGzzxXooWgb4U7rzqPd9Aq+FRtzouR72GDJaJwgzslMBh4dXVA2u8wlQUZlPP oC2rM0xmPGpkXgtREZ8eDeivCB9DWw1660ytEXCEazZuPsZXBxnMRbjoXncnS1x/NZTmj3lLl A3r7laDH/Q== X-Scanned-By: MIMEDefang 2.78 on 81.169.212.23 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by h2774747.stratoserver.net id x1R5PmAO010620 Status: R X-Status: X-Keywords: X-UID: 8166 > in the early days of TeX that was in fact a big headache and there are > still a lot of traces in 2e where we tried so save individual tokens > like using \@plus (one token) to "plus" (4). Same for registers, when > there were less than 255 available for general use. Yes, I’ve seen those, along with the several numerical constants. > However with the current limits it doesn't seem at all likely that you > could actually hit a boundary. I looked at the log after running a test document that loaded many large packages, and, even then, only a small portion of the available csnames and registers were used. I probably should’ve tried that test first! >> Would it be a worthwhile effort to conserve both csnames and registers >> by reusing some variables across template implementations for the same >> object type, or would it be better to stick to the convention of having >> completely independent sets of variables for each implementation, and >> wait to see if it becomes a concern later on? > > On the whole I would say no, because if you do that then you need add a > lot of extra code to ensure that nested objects do not accidentally > overwrite stuff before it has been used successfully. This is is still > a possible headache if you nest the same type of objects, of course, but > then that is immediately clear to the programmer that the code must > account for that. If basically arbitrary code uses the same registers or > variables then the problem is much worse. I very much agree with you. I wonder if it’d be a good idea to update the wording in interface3 of the sections documenting public scratch registers to indicate that dedicated variables should be preferred for production code. Though, I now find myself a bit confused about how TeX handles csnames. I remember reading somewhere on tex.SX that there tend to be many hash collisions, but given that TeXLive provides, by default, a hash table of 615,000 entries, I think it’d be awfully difficult to have any collisions at all, especially when the average document may use less than 25,000 csnames. I suspect that the table isn’t actually that big, but 615,000 is just the maximum number of csnames allowed. I haven’t been able to confirm or deny that yet, but I’ve probably been looking at the wrong parts of the sources files. —Kelly