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

Re: [perl #62056] Variable expansion in same regex as \N{} escaperesults in compilation error.

Thread Previous | Thread Next
From:
Ben Morrow
Date:
July 15, 2009 17:00
Subject:
Re: [perl #62056] Variable expansion in same regex as \N{} escaperesults in compilation error.
Message ID:
20090715235958.GA95952@osiris.mauzo.dyndns.org
Quoth schwern@pobox.com (Michael G Schwern):
> 
> Seems to me the problem is there's not just one charnames.  There's lots of
> them.  :full, :short, :alias, greek, cyrillic... and you can even define you
> own.  How do you know which one is in use?
> 
> This comes down to how charnames works.  There's not a big table somewhere,
> you export a "translator" function... which probably looks at some big table
> on disk.  But it means only one translator can be in effect at any given time.
>  This seems to me like overkill.
> 
> On the one hand, who cares?  Its not like its bad if there are too many
> charname symbols.  Consider \N{...} a big namespace and leave it up to the
> charnames authors to be polite and not clobber each other.

But what about

    ~% perl -E'
        {use charnames "latin"; 
            say charnames::viacode(ord "\N{upsilon}")}
        {use charnames "greek"; 
            say charnames::viacode(ord "\N{upsilon}")}'
    LATIN SMALL LETTER UPSILON
    GREEK SMALL LETTER UPSILON

and other cases of conflict? One of the points of charnames is to avoid
having to say LATIN SMALL LETTER BLAH WITH MANY EXTRA VERY VERBOSE
DIACRITICALS all the time, in favour of shorter but ambiguous names: it
would be a shame to lose that.

Ben


Thread Previous | Thread Next


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