[M3devel] Widechar literals [Was Re: Oops, forgot to ask (Rodney M. Bates)

Rodney M. Bates rodney_bates at lcwb.coop
Thu Dec 17 20:30:39 CET 2009


If the literal (CHAR or TEXT) is not wide, you can have a backslash
followed by exactly 3 octal digits as an escape.  Or, backslash,
followed by 'x' or 'X', followed by exactly two hex digits.


For wide literals (WIDECHAR or TEXT), the number of
octal digits is exactly 6 and for hex, exactly four.

The hex digits are not case sensitive.  The same is true for
hex digits in numeric literals too.

Peter Eiserloh wrote:
> Thank you Rodney.
> 
> So, if I wanted to represent GREEK SMALL LETTER ALPHA:
> 
> CONST
>    GreekSmallAlpha = W'03B1';  (* WIDECHAR *)
> 
> I may not have understood properly.
> 
> This is not explained in
>    http://www.opencm3.net/doc/reference/texts.html

   ^ --- I've put this on my list to fix.

> 
> There should be a way of specifying that this is a
> hex value.  Octal values are of course introduced
> with a backslash followed by a three octal digits.
> I would have liked to see something like a backslash
> followed by an x or X and four hexadecimal digits
> to give the 16-bit value.  As in W'\x03B1'.
> 
> If we were to ever get full unicode support (20-bits)
> we may need an escape for it.  The unicode standard
> lists code points as in "U+003B1", so a similar escape 
> may look like W'\u003B1'.
> 
> 
> Next question: are the hexadecimal digits case insensitive?
> 
> 
> 
> Peter
> 
> 
>> Date: Wed, 16 Dec 2009 17:35:29 -0600
>> From: "Rodney M. Bates" <rodney_bates at lcwb.coop>
>> Subject: Re: [M3devel] Oops, forgot to ask
>> To: M3Devel <m3devel at elegosoft.com>
>> Message-ID: <4B296EC1.1080407 at lcwb.coop>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Peter Eiserloh wrote:
>>> Hi Gang,
>>>
>>>
>>>
>>> 1 - How does one write a WIDECHAR literal?  Are WIDECHAR
>>> currently only 16-bits?  If so they are limited to only
>>> the basic multilingual plane (BMP).
>> Put a 'W' or 'w' immediately before the opening single
>> quote of a character literal, and it becomes a WIDECHAR
>> literal.  It has type WIDECHAR, allows characters with
>> 16-bit codes, and also allows 16-bit octal and hex escapes.
> 
> 
> +--------------------------------------------------------+
> | Peter P. Eiserloh                                      |
> +--------------------------------------------------------+
> 
> 
>       
> 



More information about the M3devel mailing list