Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Wed, 12 Aug 2009 02:34:34 +0200 Received: by mail.proteosys.com (8.14.3/8.14.3) with ESMTP id n7C0YUmj003916 for ; Wed, 12 Aug 2009 02:34:31 +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 n7C0UIjj018840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 12 Aug 2009 02:30:19 +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 n7BM1sGB017198; Wed, 12 Aug 2009 02:30:10 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.5) with spool id 284310 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 12 Aug 2009 02:30:09 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id n7C0U996028133 for ; Wed, 12 Aug 2009 02:30:09 +0200 Received: from rv-out-0708.google.com (rv-out-0708.google.com [209.85.198.245]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id n7C0U4Sh004280 for ; Wed, 12 Aug 2009 02:30:08 +0200 Received: by rv-out-0708.google.com with SMTP id c5so1177485rvf.10 for ; Tue, 11 Aug 2009 17:30:03 -0700 (PDT) Received: by 10.140.172.21 with SMTP id u21mr2469571rve.193.1250037003868; Tue, 11 Aug 2009 17:30:03 -0700 (PDT) Received: from ?129.127.15.244? ([129.127.15.244]) by mx.google.com with ESMTPS id g22sm32798126rvb.2.2009.08.11.17.30.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 11 Aug 2009 17:30:02 -0700 (PDT) Content-Type: multipart/signed; boundary=Apple-Mail-1--1000625191; micalg=sha1; protocol="application/pkcs7-signature" Mime-Version: 1.0 (Apple Message framework v935.3) References: <4A7921CF.5020803@morningstar2.co.uk> <4A7A1505.4040604@residenset.net> <4A7AD930.2090106@residenset.net> <8516B615-51AA-4D90-BB7D-A9E122AA0335@gmail.com> <4A816C31.9080401@residenset.net> <4A817463.8000805@morningstar2.co.uk> <4A81E3CA.6050608@residenset.net> X-Mailer: Apple Mail (2.935.3) X-Spam-Whitelist: Message-ID: Date: Wed, 12 Aug 2009 09:59:57 +0930 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Will Robertson Subject: v expansion, was xparse To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <4A81E3CA.6050608@residenset.net> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-ProteoSys-SPAM-Score: -6.599 () BAYES_00,RCVD_IN_DNSWL_MED X-Scanned-By: MIMEDefang 2.65 on 213.139.130.197 Return-Path: owner-latex-l@LISTSERV.UNI-HEIDELBERG.DE X-OriginalArrivalTime: 12 Aug 2009 00:34:34.0723 (UTC) FILETIME=[AA671B30:01CA1AE4] Status: R X-Status: X-Keywords: X-UID: 5895 --Apple-Mail-1--1000625191 Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable On 12/08/2009, at 7:04 AM, Lars Hellstr=F6m wrote: > Joseph Wright skrev: >> The re-factor saw us drop "O", and sort-of downgrade "o" (we use it >> less). The V specifier lets you write both >> \foo_internal:V \l_my_tl % A macro at the TeX level >> and >> \foo_internal:V \l_my_toks % A toks at the TeX level > > (o.0) > > Does it inspect the argument at runtime to figure out which of the =20 > two cases is at hand? Looks rather fragile & syntactic sugar to me. The heuristic is fairly safe, I believe. It uses \ifx\noexpand#1#1 to =20= detect whether the argument is a macro, and if it is not inserts \the =20= to extract the value of the toks/dim/whatever. The whole thing takes =20 place inside a \romannumeral expansion so the number of expansion =20 steps is constant. >> whereas \foo_internal:o would need >> \foo_internal:o {\l_my_tl} >> \foo_internal:o { \toks_use:N \l_my_toks } > > I think I would rather prefer that, myself! Only because you know what is happening underneath :) But, furthermore, this only works if no error checking is to occur as =20= the variable is "got". With "V", provided the error checking is =20 expandable, this can be transparently enabled without messing up code =20= like the example above. (There is no error checking at present, but may be added conditionally =20= in the future.) The idea is that the V expansions are a consistent wrapper around =20 "getting a variable", and needn't change if the underlying machinery =20 becomes different. >> So V is preferred for accessing variables (as the internal =20 >> structure is >> not important), > > Wouldn't you still need to know the variable's "internal structure" =20= > when setting it? But setting does not need to be done in a known number of expansion =20 steps, so the setting functions \toks_set:Nn, \tl_set:Nn, etc., all =20 behave analogously. Will= --Apple-Mail-1--1000625191 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGITCCAtow ggJDoAMCAQICECN4qE5kBXLk2f/jVDfSZPwwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA5MDEyOTA1NDkxNVoXDTEwMDEyOTA1NDkx NVowQjEfMB0GA1UEAxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjEfMB0GCSqGSIb3DQEJARYQd3Nw cjgxQGdtYWlsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL0BeSiAbKuqxeRN p2qn/m8ZL+xawr/WXyPgEF0FipWgRe9l3sMXcFHokcUu0xOc97R7xkUsGcQ8EyybGHuWey6x7X1Y xJZXnoAxqcaG+eREytoYGMIKs6BhEEogLVb2ERw3lQNVnOzanSFeGo8suMAN4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