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

RFC: Use" \c{...}" for controls and non-ascii character input

Thread Next
karl williamson
April 9, 2010 01:18
RFC: Use" \c{...}" for controls and non-ascii character input
Message ID:
The first part of this proposal would make \c{CAN} be the cancel 
character; \c{VT} be the vertical tab; \c{NEL} would be the "next line", 

The second part would have \c{a:} be ä, \c{o`} be ò, \c{1/2} be the 
fraction one-half, etc.  Mostly these would match the vim editor's 
digraphs for entering such characters.

This is more succinct and faster than using the \N{...} forms, and 
clearer and portable in contrast to \o and \x.

I propose that only the characters in the Latin1 range be encoded, but 
it could eventually be extended beyond that.

To do this proposal requires changing "\c{" from what it currently 
means.  What that is is undocumented, and I believe undefined anywhere. 
  On EBCDIC platforms, it generates the fatal error "unrecognised 
control character".  On ASCII platforms, because nobody checked for it, 
and because of the vagaries of the algorithm used, it silently generates 
a semi-colon.

I believe that we can consider this sequence as available for 5.14.  If 
desired, I could add a test for 5.12.1 that deprecates this (and 
probably all the other undefined sequences, such as "\c3" (which yields 
the same error in EBCDIC, and silently an "s" in ASCII)).

Your reactions?

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About