Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id t6O1YMEj031700 for ; Fri, 24 Jul 2015 03:34:23 +0200 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx106) with ESMTPS (Nemesis) id 0LdtZH-1YacgN2FQh-00j03b for ; Fri, 24 Jul 2015 03:34:16 +0200 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 t6O1UU8n025769 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Jul 2015 03:30:31 +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 t6NM13QG012179; Fri, 24 Jul 2015 03:30:30 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 12448402 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 24 Jul 2015 03:30:30 +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 t6O1UUat024267 for ; Fri, 24 Jul 2015 03:30:30 +0200 Received: from mail-ig0-f175.google.com (mail-ig0-f175.google.com [209.85.213.175]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t6O1UNT6025724 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Fri, 24 Jul 2015 03:30:26 +0200 Received: by igbpg9 with SMTP id pg9so24541762igb.0 for ; Thu, 23 Jul 2015 18:30:23 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.107.35.144 with SMTP id j138mr19233228ioj.105.1437701423060; Thu, 23 Jul 2015 18:30:23 -0700 (PDT) Received: by 10.36.81.201 with HTTP; Thu, 23 Jul 2015 18:30:22 -0700 (PDT) References: <55A8C0C2.3040908@morningstar2.co.uk> <20150717095912.GA6487@hzdr.de> <55A8E267.1030901@morningstar2.co.uk> <20150717140025.GA10619@hzdr.de> <55A90BC0.6020102@morningstar2.co.uk> Content-Type: text/plain; charset=UTF-8 Message-ID: Date: Fri, 24 Jul 2015 03:30:22 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: expl3 boolean expressions: lazy evaluation To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: 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:/KtCLjlcZVw=:hUbawTr09+QoBXzkT6wDlyKlET K/t8ARSkEmBjbIOZKre1FA52Z7ADqCjNmmljPaAZPFd2eMhlJkd71Mc5VqlGDf0dLvm/pZ5B7 IJ/TVqq1FooIuzZj7h79E2X7y07PXGDwWoPpD9BA6EZENB/iPA5msF6wDsdEjJGnmmgcGvRKx ySBB9Ewr7SWGGI5E3rdx+Cf7NY+xBbEsFb/3n/Sdf/Ba9wRixq0+yAHuUTkeI9Pvi4nFa2QgO WF00a3vtXBVrMA1SK3ckUpnWyOWQDK6lrinOiCHfKJ4IMtiEmFknZAGJjBhCaLAgeZ9xUQ3Mc qnfwRfTGR0o0zBuU949wG74mAdde5dwTRllZf/VaxCiu/bkhKqsUmwCQ3NIA5urviJMmR8eV6 xA3nmLf4KfvjitGKyYyVPGy5vjHMXhvAB44Zd9fLO0OyRo0zGPocpwfMEK1oA5mQu5mq4Q8jq 387Dh4zcWVX5wb3fCSMPiA2OM55RK6JrKzcC4+Ti4HvDIvb1/eiif1h1eHKdMhRbiKqt0vw0j 9OEYwO7C5EBVTSDrUWUTD0XDx1t7L4xIqPl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dICShbo64mFA2n1 eQ89Rpk7FpbMTcP8kdKGVr8GHIeMDa1f/QTc44GS1k9OKPcDhM8NX0xrwNz1OxbcqUPN3Z8ZV oQLuK1Ky/BIrda1zD2AsfWhL4hidCKkG27HykSFf4AWKNQzmLJv8WmaiygxuiVSJRVwL6k672 gl/DScYzE8S8uaymdjn9CQ6lvoJRwQ9q7IeH9CVfDbRbmTdeA3Dtiaon/QjMNtkyiGrF7J75q Q1dBqJYPLHsINQN2kY+pEVRZJGn+v3eAVC7gjLXQd+AOqqoCt7mAIW4ji87/8lxncO5J66yzG Ihd1qJNLNh0fRqn6hNLIlHVdJU7n9gF70auLhh2yPGBEqNc0tLFPcjP8g/KdKdznQl5fYU9nT KgcmfwL+2afbxrSBB98rmUs2z/SdZ/TTyt5jZORFDxJfEyfuaB7Io+uBs7eN69ANPtoNhIj8F hILGWaO1q8u2k7q3jbS2QZdwkxpGSds+YbY/KCVIxOIItIdLcCsJ X-Scanned-By: MIMEDefang 2.71 on 85.214.41.38 Status: R X-Status: X-Keywords: X-UID: 7804 Hi Sean, > I don't believe it's out of the question to wrap macro-parameters in some > sort of \bool_validate:n (if such a thing doesn't already exist) that would > run the checks and issue appropriate errors on a case-by-case basis. I > believe it's important to assume the programmer knows what he or she is > doing and let them account for this themselves. Otherwise, you introduce > complexity where none is needed for a large portion of folks. Can you clarify what your suggested \bool_validate:n is meant to do? Your description is too short for me to have any idea what it is. If we leave things as they are, I am pretty certain that programmers will fall into the pitfall of thinking that \bool_if:nTF { \token_if_eq_meaning_p:NN #1 ? || \token_if_eq_meaning_p:NN #1 ! } is safe, even though it will break horribly if `#1` is `(` or `)` (technically I haven't tested so perhaps this works by chance). The reason I am certain of this is that I fell into this trap (before I stopped using boolean expressions), even though I was aware of it. This is why we need to change something. The cheapest change in terms of amount of code and of maintainability is to drop lazy evaluation of boolean expressions. This will require changing in minor ways a few packages where lazy evaluation of boolean expressions is assumed. > Not to mention that it is just that much more to test and maintain. Actually, there is currently a mess of code that is only there to support lazy evaluation. If we get rid of lazy evaluation, I strongly expect the code underlying boolean expressions to become simpler. In fact, I believe it would be possible to provide a form of lazy evaluation when explicitly requested by the programmer. Something like \bool_if:nTF { \tl_if_exist_p:N #1 && \bool_lazy:n { \tl_if_empty_p:N #1 } } would do some trickery under the hood to prevent expansion of `\tl_if_empty_p:N #1` if `\tl_if_exist_p:N #1` gives the result `false`. Regards, Bruno