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

RFC: named sequences and charnames::vianame incompatible

Thread Next
From:
karl williamson
Date:
September 5, 2010 14:01
Subject:
RFC: named sequences and charnames::vianame incompatible
Message ID:
4C840506.3000205@khwilliamson.com
A Unicode named sequence is a single name for a string of characters. 
For example, TAMIL SYLLABLE HO is actually two characters that together 
are commonly referred to by this name.

It is easy to add these to the compile-time construct \N{...}, as that 
returns a character string of any length.  However this doesn't work for 
charnames::vianame() which currently performs essentially the identical 
behavior at runtime, as it returns a single ordinal value, so can't 
handle named sequences without changing its behavior.

I see two options that may be viable:
1) Don't change vianame, but perhaps add another function which performs 
identically to \N{}, but at runtime.

2) Change vianame so that in list context it returns the list of 
ordinals that make up a name.  In scalar context it would return undef 
for these.  This isn't strictly backwards compatible, as someone could 
currently be calling vianame in list context and get just the single 
ordinal.  And now they could get an array returned that has multiple 
entries, but only for names that currently return undef.

Any comments?

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