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 o178SeYn016053 for ; Sun, 7 Feb 2010 09:28:41 +0100 Received: (qmail 12293 invoked by alias); 7 Feb 2010 08:28:35 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 07 Feb 2010 08:28:34 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx046) with SMTP; 07 Feb 2010 09:28:34 +0100 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 o178Qc8B024776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 7 Feb 2010 09:26:39 +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 o16N143E024014; Sun, 7 Feb 2010 09:26:27 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 378639 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sun, 7 Feb 2010 09:26:27 +0100 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 o178QR2x011227 for ; Sun, 7 Feb 2010 09:26:27 +0100 Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.211.174]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id o178QMjO022945 for ; Sun, 7 Feb 2010 09:26:26 +0100 Received: by ywh4 with SMTP id 4so4810713ywh.10 for ; Sun, 07 Feb 2010 00:26:22 -0800 (PST) Received: by 10.151.18.38 with SMTP id v38mr6836367ybi.274.1265531182208; Sun, 07 Feb 2010 00:26:22 -0800 (PST) Received: from ?10.0.1.102? (114-30-116-62.ip.adam.com.au [114.30.116.62]) by mx.google.com with ESMTPS id 4sm1039240ywg.28.2010.02.07.00.26.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 07 Feb 2010 00:26:20 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) References: <4b6c8efc$0$6573$9b4e6d93@newsspool3.arcor-online.net> <09bdfa24-c77c-4f37-8c89-809befb28934@u41g2000yqe.googlegroups.com> <4b6cc60a$0$6581$9b4e6d93@newsspool3.arcor-online.net> X-Mailer: Apple Mail (2.1077) X-Spam-Whitelist: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id o178QR2x011228 Message-ID: Date: Sun, 7 Feb 2010 18:56:12 +1030 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Will Robertson Subject: Re: Newbie Question on LaTeX 3 Programming To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p6i75npGen84eVAEFK/syJmiNoEBJhgjYKpglu1TZLLw7xMZnJMXwBFK0zrU udEInhYyaWAzwtcf5K2pCdD+gZ2/z4PnBLkwixZI+pVtXqOlCN41sOWgjaVeH7+UhPxHlGxFK/rc sw7fg==V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de X-Scanned-By: MIMEDefang 2.63 on 85.214.41.38 Status: R X-Status: X-Keywords: X-UID: 6222 On 07/02/2010, at 7:36 AM, Joseph Wright wrote: >> - What is the conceptual difference between token lists and token >> registers? In what cases should I use which one? > > At the implementation level, a token list is a macro, whereas a token > register is, well, a token register. Most of the time, token lists are > more convenient as they don't need an access function. There are a > really limited number of places where a token register is needed: > - When the stored material might contain # tokens > - When you want to have exactly one expansion inside an x scenario > That is of course the same as any other TeX programming, but we should > I guess discuss this somewhere. l3toks contains a short discussion of this at the beginning: % There are fewer restrictions on the contents of a token register over % a token list variable. So while \meta{token list} is used to describe % the contents of both of these, bear in mind that slightly different lists % of tokens are allowed in each case. The best (only?) example is that a % \meta{toks} can contain the "#" character (i.e., characters of catcode 6), % whereas a \meta{tl var.}~will require its input to be sanitised before that is % possible. % % If you're not sure which to use between a \meta{tl var.}~or a \meta{toks}, % consider what data you're trying to hold. If you're dealing with function % parameters involving "#", or building some sort of data structure % then you probably want a \meta{toks} (e.g., \file{l3prop} uses \meta{toks} % to store its property lists). % % If you're storing ad-hoc data for later use (possibly from direct user % input) then usually a \meta{tl var.}~will be what you want. Improvements welcome. >> - Why is there no separate stack/queue data type? > > That is what sequence stacks are for: expl3.pdf, p. 12: > > "l3seq This implements data-types such as queues and stacks" > > This is where I have used the seq data type rather than using comma > lists: when wanting to set up a stack. Right; comma-lists for user-based input (or where the commas just make sense) and seqs for more robust storage of arbitrary material. Morten has implemented a more generic data type for expl3 in which (if I recall correctly) items can be referenced with indices as well as with using push/pop operations, but they have yet to make a public appearance. -- Will