From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 24 07:02:34 2023 Received: (at submit) by debbugs.gnu.org; 24 Sep 2023 11:02:34 +0000 Received: from localhost ([127.0.0.1]:41162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkMsj-0003R4-IM for submit@debbugs.gnu.org; Sun, 24 Sep 2023 07:02:34 -0400 Received: from lists.gnu.org ([2001:470:142::17]:38348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkMsf-0003Qo-B5 for submit@debbugs.gnu.org; Sun, 24 Sep 2023 07:02:32 -0400 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 1qkMsN-0005Qr-OC for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 07:02:11 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkMsL-0005cV-QU for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 07:02:11 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1c44c0f9138so31773285ad.2 for ; Sun, 24 Sep 2023 04:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695553327; x=1696158127; darn=gnu.org; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=tPfhIbn+7LpnH/HuNa3rrFTOWtAD/yK5jQr7fJZ9UDE=; b=RAVJkE6ipz+cv4Brzm1KzZylh9D63/shQCfCxi0638AYjJSHna4qdV7Savf8Mbi+69 NQHWyCy3SQzZdpvN82MvpkytRhifG1bEJkm3GVrwDZ9r9IWw+lfkKtKtDsvsPWv8/rVe XDdFSDq4LnJCrNw1a8SPY1/RPNylENQrOX8B/3GygEHvPNc8wKUYlNE3aaHl9h+2Rl94 cWb86h2MIcdkWozi7Bbu3c3+lXSCC4Qa8yvSHO7txz0IfbUWzzAFg+jjt9Gmcp/iAf9a itgsTsHwkfz+Vhi820iHUMhQxBUAPWAEQCYb13Ns3bdsriHateBhwBgjZeKuehINjp55 DlKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695553327; x=1696158127; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=tPfhIbn+7LpnH/HuNa3rrFTOWtAD/yK5jQr7fJZ9UDE=; b=bFphpE4SlJfhe73S4iM8NsP05Fv9YFCGKVbuiFfqkrahlbF69EH7KIRzLP2qCOtGS8 os0uEKtFL4f0NTPzQiBKjfl2jTu+KNxVOomFVtkRxFYax5conju5Xg6PxqcUkZoPOL1m roMPvgWr9WWRFGIU1Glb5BUnhrU+RbNR9p0HeAYZ1YIOr2BCPQice67vgcQcSGTbQ4Xm FMSectAc7Wu35fI8AOwS5vdi+2a6mHEzVG+Lrncbfur8vtmNhvXHsHbSg2pY8xGqK9Os dcTrxHkkRxkwFx+PePIBEUEGBd19PSNnYyQeXKnnjB1OTGslgqFlhlXYa93FL93RLRJJ FLmQ== X-Gm-Message-State: AOJu0Yxqo/AccF5JXM6tuVpQxfwVcqLPohGssbCG2Najo6WYtxDsSblf WxhVTJZnVFQj9wP0ZF8CVUbCleD419Q= X-Google-Smtp-Source: AGHT+IGOsl0BHhaLwlMbC2LRaucY/x6wzoPXmND9Y2hR1MeqBg5EYdXJ35Z3Ap4QoB6JVAVPTtPu5A== X-Received: by 2002:a17:902:bd82:b0:1c1:f1db:e86d with SMTP id q2-20020a170902bd8200b001c1f1dbe86dmr2336379pls.7.1695553327122; Sun, 24 Sep 2023 04:02:07 -0700 (PDT) Received: from [192.168.0.234] ([152.168.142.156]) by smtp.gmail.com with ESMTPSA id e12-20020a170902d38c00b001c3cbedbc47sm6671145pld.6.2023.09.24.04.02.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 Sep 2023 04:02:06 -0700 (PDT) Message-ID: <1817567d-4fce-cd09-a34f-89e30186c0b3@gmail.com> Date: Sun, 24 Sep 2023 08:02:04 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Content-Language: en-US To: bug-gnu-emacs@gnu.org From: Mauro Aranda Subject: 30.0.50; cperl-mode inconsistent hash key fontification Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=maurooaranda@gmail.com; helo=mail-pl1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) emacs -Q C-x C-f bug.pl M-x cperl-mode my %factorial = (          0 => 1,          zero => 1         ); zero is recognized as a string, 0 is not. In GNU Emacs 30.0.50 (build 11, x86_64-pc-linux-gnu, GTK+ Version  3.24.33, cairo version 1.16.0) of 2023-09-24 built on tbb-desktop Repository revision: 38cd3cb4330f2c18d01fa6aa7eb54623cecab522 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12201001 System Description: Ubuntu 22.04.2 LTS Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings:   value of $LC_MONETARY: es_AR.UTF-8   value of $LC_NUMERIC: es_AR.UTF-8   value of $LC_TIME: es_AR.UTF-8   value of $LANG: en_US.UTF-8   value of $XMODIFIERS: @im=ibus   locale-coding-system: utf-8-unix Major mode: CPerl Minor modes in effect:   tooltip-mode: t   global-eldoc-mode: t   show-paren-mode: t   electric-indent-mode: t   mouse-wheel-mode: t   tool-bar-mode: t   menu-bar-mode: t   file-name-shadow-mode: t   global-font-lock-mode: t   font-lock-mode: t   blink-cursor-mode: t   minibuffer-regexp-mode: t   line-number-mode: t   indent-tabs-mode: t   transient-mark-mode: t   auto-composition-mode: t   auto-encryption-mode: t   auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cperl-mode rx facemenu perl-mode rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo gtk x-toolkit xinput2 x multi-tty move-toolbar make-network-process emacs) Memory information: ((conses 16 46684 14664) (symbols 48 6036 0) (strings 32 16403 2228)  (string-bytes 1 485689) (vectors 16 11696)  (vector-slots 8 190095 12343) (floats 8 32 17) (intervals 56 391 0)  (buffers 992 12)) From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 24 09:44:31 2023 Received: (at 66178) by debbugs.gnu.org; 24 Sep 2023 13:44:31 +0000 Received: from localhost ([127.0.0.1]:41350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkPPT-00077H-5p for submit@debbugs.gnu.org; Sun, 24 Sep 2023 09:44:31 -0400 Received: from mout02.posteo.de ([185.67.36.66]:48257) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkPPP-00076u-0b for 66178@debbugs.gnu.org; Sun, 24 Sep 2023 09:44:29 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E974F240101 for <66178@debbugs.gnu.org>; Sun, 24 Sep 2023 15:44:08 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RtnKg1rW2z9ryh; Sun, 24 Sep 2023 15:44:07 +0200 (CEST) From: =?utf-8?Q?Harald_J=C3=B6rg?= To: 66178@debbugs.gnu.org Subject: Re: bug#66178: 30.0.50; cperl-mode inconsistent hash key fontification In-Reply-To: <1817567d-4fce-cd09-a34f-89e30186c0b3@gmail.com> (Mauro Aranda's message of "Sun, 24 Sep 2023 08:02:04 -0300") References: <1817567d-4fce-cd09-a34f-89e30186c0b3@gmail.com> Date: Sun, 24 Sep 2023 13:44:02 +0000 Message-ID: <8734z3y9cp.fsf@oook.m.uunet.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66178 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 66178 + wontfix thanks Mauro Aranda writes: > emacs -Q > C-x C-f bug.pl > M-x cperl-mode > my %factorial = ( > 0 => 1, > zero => 1 > ); > > zero is recognized as a string, 0 is not. This might look surprising, but it is intentional. zero is a bareword which undergoes hash-key stringification. The digit 0, on the other hand, is converted to a string according to Perl's type conversion rules. That is a different thing: Perl's type conversion converts all of 0, 000, 0.0, 0E0 to the hash key "0". Let me expand your example to demonstrate some more cases where the hash key is (correctly) not fontified as a string: my %hash = ( "0" => 'The string "0"', "00" => 'The string "00"', 0 => 'A number which is converted to the string "0"', 00 => 'A number which is converted to the string "0"', 0.0 => 'A number which is converted to the string "0"', 0E0 => 'A number which is converted to the string "0"', zero => "A bareword which is stringified", zero() => "The function's return value is the key", +zero => "The function's return value is the key", ); -- Cheers, haj From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 24 18:21:27 2023 Received: (at 66178) by debbugs.gnu.org; 24 Sep 2023 22:21:27 +0000 Received: from localhost ([127.0.0.1]:43714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkXTi-0004Z3-Qe for submit@debbugs.gnu.org; Sun, 24 Sep 2023 18:21:27 -0400 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]:61721) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkXTf-0004Yl-WB; Sun, 24 Sep 2023 18:21:26 -0400 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-6c4e7951dc1so532411a34.3; Sun, 24 Sep 2023 15:21:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695594066; x=1696198866; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=3T0U+a7YjfnacUYm0RqYBlGrvQjiBdIFrEV7y5grL08=; b=aQo1YUWChAMrwTU0SULJHs5ADEde0u6n0PsFxpJ+w8CKyd0Hv5MJ/pXJw2V7HEq8Dj dutjmaJmnp1q6rg6ms9D55JhEFq/42mCEu+jUVv0e2erE6I7/HScjLBlhXwViDuyNZ5b IYVDoMrI5AWTJRMUsTYZrcILL2H3PTUqMkUhpiiXbHJeEwSFem+ToGA19o5IWzsXXYF7 zcz9Q2eXHmn7Tt/Wl2xqq5ghMXraSnct9uh9sNv0HD+70fM/d+0t265F7SGJLIeh4Xb1 MaKwHjvkaaKL+20zkz2eju7IIRT/XPxxRGKve6TI6xbZLxDZZL5KY7G8I+mvRVxbBBOQ G1Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695594066; x=1696198866; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3T0U+a7YjfnacUYm0RqYBlGrvQjiBdIFrEV7y5grL08=; b=SoBFfmjM10Imu3FU74yhVRBzdMz0WgA4HpLQW4otznt8agassHqbpe3gnBvtvsg/xE ydQxxayuT8vBHmfB6h+K3ArP+xZaD3cmE28iiUmGQ1OMFtMyVPdRodSnmFMrqIGCdHPk pJhe60R74Mh02HUYDg16eqCpDRC1M0/qy2KTYdRAt3KVNM6Vc73BFRO9Cbc8wmjNxxQy 9RAxnpMaoO1GvH4VCg4Jq07IY23CBSyjCTA9mtE97q7uMu/SAr4E+a4tnuUCHPfKbk8H WALD/6Vxd0df/Qfl5xYGxQ6o18yvl4+seJP3vXfUQZZbvpKkyP/mg0wwi8flhM9wWby0 ZMxQ== X-Gm-Message-State: AOJu0YxLKELi6SWLldty56GjyD3npc5b6oLWJau9eWQm8pv2cPqzrf4+ YImtkRpEXNEu0Th2QJZ3s8M= X-Google-Smtp-Source: AGHT+IFFzvPUEX0nz4U2Kgxc6+fFaH2Q38JQw8+FkrKf0R3+/2M0++U8ZAikRUwhOGir8hpmNGkACA== X-Received: by 2002:a05:6830:19a:b0:6bd:836:4fc2 with SMTP id q26-20020a056830019a00b006bd08364fc2mr6164708ota.17.1695594066009; Sun, 24 Sep 2023 15:21:06 -0700 (PDT) Received: from [192.168.0.234] ([152.168.142.156]) by smtp.gmail.com with ESMTPSA id ge8-20020a17090b0e0800b00267ee71f463sm6934152pjb.0.2023.09.24.15.21.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 Sep 2023 15:21:05 -0700 (PDT) Message-ID: <8b2fff5e-dffe-1c3d-af6e-e61fb0774ced@gmail.com> Date: Sun, 24 Sep 2023 19:21:02 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: bug#66178: 30.0.50; cperl-mode inconsistent hash key fontification Content-Language: en-US To: =?UTF-8?Q?Harald_J=c3=b6rg?= , 66178@debbugs.gnu.org References: <1817567d-4fce-cd09-a34f-89e30186c0b3@gmail.com> <8734z3y9cp.fsf@oook.m.uunet.de> From: Mauro Aranda In-Reply-To: <8734z3y9cp.fsf@oook.m.uunet.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 66178 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.5 (--) tags 66178 notabug close 66178 quit On 24/9/23 10:44, Harald Jörg wrote: > tags 66178 + wontfix > thanks > > Mauro Aranda writes: > >> emacs -Q >> C-x C-f bug.pl >> M-x cperl-mode >> my %factorial = ( >> 0 => 1, >> zero => 1 >> ); >> >> zero is recognized as a string, 0 is not. > > This might look surprising, but it is intentional. > > zero is a bareword which undergoes hash-key stringification. > > The digit 0, on the other hand, is converted to a string according to > Perl's type conversion rules. That is a different thing: Perl's type > conversion converts all of 0, 000, 0.0, 0E0 to the hash key "0". > > Let me expand your example to demonstrate some more cases where the hash > key is (correctly) not fontified as a string: > > my %hash = ( > "0" => 'The string "0"', > "00" => 'The string "00"', > 0 => 'A number which is converted to the string "0"', > 00 => 'A number which is converted to the string "0"', > 0.0 => 'A number which is converted to the string "0"', > 0E0 => 'A number which is converted to the string "0"', > zero => "A bareword which is stringified", > zero() => "The function's return value is the key", > +zero => "The function's return value is the key", > ); Thank you for the explanation, it makes more sense to me now. I'm tagging this one as notabug and closing. From unknown Sun Aug 17 22:08:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 23 Oct 2023 11:24:12 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator