develooper Front page | perl.perl5.porters | Postings from September 2009

Re: vianame returns either chr or ord

Thread Previous
From:
demerphq
Date:
September 1, 2009 05:42
Subject:
Re: vianame returns either chr or ord
Message ID:
9b18b3110909010542wadaab4bt7215318cbed6ace7@mail.gmail.com
2009/9/1 karl williamson <public@khwilliamson.com>:
> If charnames::vianame is called with a name of the form U+XXXX, it converts
> the result with chr before returning.  With any other name it returns the
> ordinal number.  This seems like a bug to me, but I want to make sure I'm
> not missing something.

It looks like it was deliberate, although possibly accidental. See below.

> I tried looking at the git blame log equivalent for this; and could only
> find the latest instance that the lines have changed.  If I click on what I
> think would take me to the older version, I get a 404 html error.
>
> The diff at
> http://perl5.git.perl.org/perl.git/blobdiff/60a1aa196c6751722bae1e1ee83a99d0d965146d..075d4edd61a9648945541c8a76d8c03d4588400b:/lib/charnames.pm
>
> shows the latest diff.  I would presume I would click on the 'a' link near
> the top to get to the older file; that gives the 404, as does the 'b' link.

Ah. Interesting. First, that is the first time ive seen that page
mode. I was able to find it viewing the tree of a commit, and then
going into the lib directory, clicking the history link there, and
then using the diff-to-current link, which then lands on a "bob diff"
mode, which apparently has broken cross links to the other view pages.
Ill see if i can figure out a fix, but you can get what you want i
think by doing:

Clicking on the commit link:
http://perl5.git.perl.org/perl.git/commit/075d4edd61a9648945541c8a76d8c03d4588400b

and then from there clicking the blame link next to the charnames file
which takes me to:

http://perl5.git.perl.org/perl.git/blame/075d4edd61a9648945541c8a76d8c03d4588400b:/lib/charnames.pm

Which seems to me to be what you wanted. Although the way the blame
works its not that useful. A little digging reveals the "return a char
for U+" was introduced with the first time vianame() started handling
U+:

http://perl5.git.perl.org/perl.git/commitdiff/dbc0d4f2f139c3775c592bb9d20ada906e3aa68e?hp=f76b0f6998c929fc8d564ca3ed8728a19879ebc7

which makes some sense as it was added to support \N{U+...} processing.

Yves



-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About