unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: "Harald Jörg" <haj@posteo.de>, 66178@debbugs.gnu.org
Subject: bug#66178: 30.0.50; cperl-mode inconsistent hash key fontification
Date: Sun, 24 Sep 2023 19:21:02 -0300	[thread overview]
Message-ID: <8b2fff5e-dffe-1c3d-af6e-e61fb0774ced@gmail.com> (raw)
In-Reply-To: <8734z3y9cp.fsf@oook.m.uunet.de>

tags 66178 notabug
close 66178
quit


On 24/9/23 10:44, Harald Jörg wrote:
 > tags 66178 + wontfix
 > thanks
 >
 > Mauro Aranda <maurooaranda@gmail.com> 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.





      reply	other threads:[~2023-09-24 22:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-24 11:02 bug#66178: 30.0.50; cperl-mode inconsistent hash key fontification Mauro Aranda
2023-09-24 13:44 ` Harald Jörg
2023-09-24 22:21   ` Mauro Aranda [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b2fff5e-dffe-1c3d-af6e-e61fb0774ced@gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=66178@debbugs.gnu.org \
    --cc=haj@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).