From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Milan Zimmermann Newsgroups: gmane.emacs.bugs Subject: bug#59612: A comment line in example change Date: Sat, 26 Nov 2022 10:59:13 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000005407f705ee61ba97" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24598"; mail-complaints-to="usenet@ciao.gmane.io" To: 59612@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 26 17:00:29 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyxbQ-0006FY-Qb for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Nov 2022 17:00:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyxb4-0003Cg-BJ; Sat, 26 Nov 2022 11:00:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyxb3-0003CL-GT for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 11:00:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyxb3-0004Q8-7X for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 11:00:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oyxb3-00024W-4Z for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 11:00:05 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Milan Zimmermann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Nov 2022 16:00:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59612 X-GNU-PR-Package: emacs Original-Received: via spool by 59612-submit@debbugs.gnu.org id=B59612.16694783987906 (code B ref 59612); Sat, 26 Nov 2022 16:00:05 +0000 Original-Received: (at 59612) by debbugs.gnu.org; 26 Nov 2022 15:59:58 +0000 Original-Received: from localhost ([127.0.0.1]:41250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyxav-00023S-RQ for submit@debbugs.gnu.org; Sat, 26 Nov 2022 10:59:58 -0500 Original-Received: from mail-ua1-f44.google.com ([209.85.222.44]:46643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyxas-00023E-Ow for 59612@debbugs.gnu.org; Sat, 26 Nov 2022 10:59:55 -0500 Original-Received: by mail-ua1-f44.google.com with SMTP id f18so2458968uam.13 for <59612@debbugs.gnu.org>; Sat, 26 Nov 2022 07:59:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=CjLRIUfvw98y1W2w2pcLLnvecaLD3yFu3zEZdu+DPtg=; b=SWYIjDEYE7ktt6SWkXMnLBYGM9Ulau7qqdjebimOV2zi6QplxgPjNHN6a1ppdanwvc BvpVAYtB5R6w6yTxzyScCy6aSTz/8VanMoa8svnCw03Gz7GwoLV5puPA9SVIt+qZci+y uStyoazfnFOeqFo8OFdU6fj/t7D+nxSE1QjOf570eQCGi6hkedItHPv9VnJBeGvBpZco DGPOkFXsR8+wPJHrZhxkPO5meDL5rYFgGsQQIJzeQ7kflqgqCKaDCmHPNIJvOMB++1dW ItOkUnlyCu5qVRT7zwyva05XJv1qxcQWWn8Q2lnpKvqYS3FYebPZz/dgjCoLWdr+dI7e z7zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CjLRIUfvw98y1W2w2pcLLnvecaLD3yFu3zEZdu+DPtg=; b=Ze2noicFIFOKzhof718hjF5SYzVu7ZtUMw8Q+PRfuJh2vwrgXbzXetHGycBGhOlA5Z U0WNWLCRiiRkydfD1R7NOVFkUqLA4Bg6qbPzH+d0kCKZHNxvH02U4vLP/7V1Kfdzn5s8 YB95g8BKYtJmF/SS42yM85s/ysszMfttXkuMNN2VBIpXI9wMFrt0+zebQ8x55LMnNqbh xdnxzSBGGjp8ejw7VLZDmvToGRZRWrFTMUxplo6mJoFQvaYPVd01jK3ZFXgyREap8Yzx TV6SDEeFamt0zBMDBkXtxamaQwYGuCheD6w9rhgeRQW57FwVOQX9Luofb5zTpQDIOc4b D6FQ== X-Gm-Message-State: ANoB5pmI29CTSgQxmU8MsttI2cBc69EpjuRc1xl7kkXKoeORmGyzJWiB Zd4VTdf60OiP9TDBUXSRuXSueXIpkwVwuLKNINMgz3Mf0Cg= X-Google-Smtp-Source: AA0mqf6r45G6uEaeYQCIVGw/qj+R51kZ+lrmtiOzpfPv67hQ9eEipKTaZBUfuSOLSKEn/kpfOuYU2XYFXkO+i7miQPw= X-Received: by 2002:ab0:770d:0:b0:418:c7de:f649 with SMTP id z13-20020ab0770d000000b00418c7def649mr19810356uaq.4.1669478388859; Sat, 26 Nov 2022 07:59:48 -0800 (PST) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249107 Archived-At: --0000000000005407f705ee61ba97 Content-Type: text/plain; charset="UTF-8" The script I provided has a mis-typed comment on line 6. The script should be: ################################################################ # The behavior of conditionals depends on whitespace # Source this script to test it # This formatting works as expected; evaluates the "true" block. # Result: # "It is 2" # <=== The original had a typo here, included NOT # if { = 2 2 } { echo "It is 2" } { echo "It is NOT 2" } # This formatting causes a BUG: both the "true" block and the "false" block are evaluated. # I tried several combinations, it appears it the "false" block starts on it's own line, # it is no longer treated a part of the "if" expression. Which could be argued # is expected because there is no "else" that would define whether the second block # is not part of the "if" expression. BUT see next test # # Result: # "It is 3" # "It is NOT 3" # if { = 3 3 } { echo "It is 3" } { echo "It is NOT 3" } # BUT we get the same incorrect result if we place the whole if expression into {} { if { = 4 4 } { echo "It is 4" } { echo "It is NOT 4" } } ###################################################################### --0000000000005407f705ee61ba97 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The script I provided has a = mis-typed comment on line=C2=A06. The script should be:

################################################################
# The = behavior of conditionals depends on whitespace
# Source this script to t= est it

# This formatting works as expected; evaluates the "true= " block.
# Result:
# =C2=A0"It is 2" # <=3D=3D=3D T= he original had a typo here, included NOT
#

if { =3D 2 2 } {
= =C2=A0 echo "It is 2"
} {
=C2=A0 =C2=A0echo "It is NOT= 2"
}

# This formatting causes a BUG: both the "true&qu= ot; block and the "false" block are evaluated.
# I tried sever= al combinations, it appears it the "false" block starts on it'= ;s own line,
# it is no longer treated a part of the "if" expr= ession. Which could be argued
# is expected because there is no "el= se" that would define whether the second block
# is not part of the= "if" expression. BUT see next test
#
# Result:
# =C2=A0= "It is 3"
# =C2=A0"It is NOT 3"
#

if { =3D= 3 3 } {
=C2=A0 =C2=A0echo "It is 3"
}
{
=C2=A0 =C2= =A0echo "It is NOT 3"
}

# BUT we get the same incorrect= result if we place the whole if expression into {}
{
=C2=A0 if { = =3D 4 4 } {
=C2=A0 =C2=A0 =C2=A0echo "It is 4"
=C2=A0 }
= =C2=A0 {
=C2=A0 =C2=A0 =C2=A0echo "It is NOT 4"
=C2=A0 }}
#####################################################################= #
3D""
--0000000000005407f705ee61ba97--