Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id t6HBBNOn009487 for ; Fri, 17 Jul 2015 13:11:24 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx012) with ESMTPS (Nemesis) id 0LhSme-1YcIsv2EEa-00mdnN for ; Fri, 17 Jul 2015 13:11:17 +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 t6HB9gUm028753 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Jul 2015 13:09:43 +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 t6H8SHFr028762; Fri, 17 Jul 2015 13:09:42 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 12358142 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 17 Jul 2015 13:09:42 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t6HB9gBO023018 for ; Fri, 17 Jul 2015 13:09:42 +0200 Received: from ftx-008-i773.relay.mailchannels.net (ftx-008-i773.relay.mailchannels.net [50.61.143.73]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t6HB9XeN026757 for ; Fri, 17 Jul 2015 13:09:38 +0200 X-Sender-Id: netnames|x-authuser|joseph.wright@morningstar2.co.uk Received: from smtp3.easily.co.uk (ip-10-229-11-165.us-west-2.compute.internal [10.229.11.165]) by relay.mailchannels.net (Postfix) with ESMTPA id 5E89E1D0E38 for ; Fri, 17 Jul 2015 11:09:30 +0000 (UTC) X-Sender-Id: netnames|x-authuser|joseph.wright@morningstar2.co.uk Received: from smtp3.easily.co.uk (smtp3.easily.co.uk [10.45.8.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.5.1); Fri, 17 Jul 2015 11:09:31 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: netnames|x-authuser|joseph.wright@morningstar2.co.uk X-MailChannels-Auth-Id: netnames X-MC-Loop-Signature: 1437131370902:3102071253 X-MC-Ingress-Time: 1437131370902 Received: from [139.222.114.154] (port=53894 helo=[139.222.114.154]) by smtp3.easily.co.uk with esmtpa (Exim 4.43) id 1ZG3WC-0005NG-9K for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 17 Jul 2015 12:09:28 +0100 References: <55A8C0C2.3040908@morningstar2.co.uk> <20150717095912.GA6487@hzdr.de> X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit X-AuthUser: joseph.wright@morningstar2.co.uk Message-ID: <55A8E267.1030901@morningstar2.co.uk> Date: Fri, 17 Jul 2015 12:09:27 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: expl3 boolean expressions: lazy evaluation To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <20150717095912.GA6487@hzdr.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-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:a6eBOwmqvFQ=:2E9NT0XlC63IgsiGajwwMMRqju UFP4esLe75x7zDH6y4ni2bCkDfcZCfpYnNSB15X0OpgaFmXEV+Vuv+GByja0gYrb8WKmlEC1o 0Dezx3TQmUO9HuwRQp2csn6br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, Alexander Grahn wrote: >> \bool_if:nTF >> { >> \cs_if_exist_p:N \pdftex_pdfoutput:D >> && \int_compare_p:nNn \pdftex_pdfoutput:D > \c_zero >> } >> { pdfmode } >> { dvips } >> >> will fail as the second test will not be skipped. We note though that >> this case is likely unusual: in general expl3 variables should be >> declared before use so should. A quick sweep over TL2015 shows the >> following packages would have to be updated following any change: >> >> - media9 >> -ocgx2 >> >> (Other packages do use \cs_if_exist_p:(N|c) but not in a way which >> relies on lazy evaluation.) >> >> Are there other obvious issues if we switch from lazy evaluation? If the >> change is to be made we intend to work with package authors in advance >> to make sure that users are not impacted. > > thank you for pointing out this. Could you please give me specific > advice on the changes I will have to do? > > Kind regards, > Alexander Hi Alexander, As I said, at present we've not changed anything precisely because we are not sure whether dropping lazy evaluation is acceptable. (It's a tricky balance: having an issue with ")" tokens is also not ideal.) The reason I've raised on LaTeX-L is we want to be sure the proposed change doesn't cause significant issues either for end-users or for programmers. Assuming we do make a change and evaluate all parts of an expression then doing \bool_if:nT { \cs_if_exist_p:N && \some_test:N } won't work if the second test only works if is defined. In your code you've got three places I can see where \cs_if_exist_p:N or \cs_if_exist_p:c is used as the first test in an expression, so the second one will fail. The options are then to rewrite as a set of nested TF versions \cs_if_exist:NTF \foo { } { } or to use a bit of imagination to avoid that. Assuming the latter is wanted, in media9 you could replace \bool_if:nTF { !\cs_if_exist_p:c {#1} || !\str_if_eq_x_p:nn {\tl_use:c{#1} } {#2} } by \bool_if:nTF { !\cs_if_exist:cTF {#1} { \str_if_eq_x_p:nn { \tl_use:c {#1} } {#2} } { \c_false_bool } } and replace \bool_if:nT { \cs_if_exist_p:N \fxocg@insert@OC && !\tl_if_blank_p:V \fxocg@insert@OC } by \bool_if:nT { ! \cs_if_exist:NTF \fxocg@insert@OC { \tl_if_blank_p:V \fxocg@insert@OC } { \c_true_bool } } In ocgx2.sty there is \bool_if:nT { !\cs_if_exist_p:c { OCGpdfobj#3 } || !\str_if_eq_x_p:nn { \use:c { OCGpdfobj#3 } } { \use:c { ocgxii@#3 } } } which could be redone as for the first case in media9. However, reviewing the code I realise that as you have \use:c here you'll actually get away with it (the second part will evaluate even if the csname is undefined). If you do want a 'safe' change then \bool_if:nTF { ! \cs_if_exist:cTF { OCGpdfobj#3 } { \str_if_eq_x_p:nn { \use:c { OCGpdfobj#3 } } { \use:c { ocgxii@#3 } } } { \c_false_bool } } (BTW, I assume ocgxii@#3 is known to be defined!) I hope this makes sense. -- Joseph Wright