support for unicode in identifiers

Chris Nicholson-Sauls via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 1 16:43:21 PDT 2014


On Sunday, 1 June 2014 at 22:26:42 UTC, Vlad Levenfeld wrote:
> I was pretty happy to find that I could use mu and sigma when 
> writing statistical routines, but I've found that for more 
> obscure non-ascii characters the support is hit or miss. For 
> example, none of the subscripts are valid characters, but I can 
> use superscript n as well as dot-notation for derivatives.
> I'm using dmd 2.065. What's the story behind the scenes? Is 
> there a rationale behind the supported/unsupported or is it 
> happenstance? Is there anywhere I can find a list of supported 
> characters?

The allowed characters are those defined as "universal" in 
ISO/IEC 9899 (the C standard).  It's a pretty long list, but 
almost only "alphas;" I'm actually surprised you got superscripts 
and some other things to work.

As I understand it, the intention was a) be like C99, and b) 
allow things like using "stærð" rather than "staerdh."  I'm not 
sure usage like yours was even thought about, although I'd 
concede that it seems reasonable.


More information about the Digitalmars-d-learn mailing list