Unicode symbols in the identifiers

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Jan 10 19:54:55 PST 2013


On Fri, Jan 11, 2013 at 03:09:29AM +0100, Andrey wrote:
> Should these variants serve as identifiers?
> 
> auto x²; //fails to compile: char 0x00b2 not allowed in identifier,
> unsupported char 0xb2 (why? is it not a digit?)

Weird, identifiers like "Цвет" and "張" and even "ℝ" all work fine, but
"⅀" doesn't work. Maybe it's a bug?


[...]
> Still, this function name in russian cause compile error: 2.вквадрате
> (вквадрате(2))

This works for me:

	import std.stdio;
	real плюс(real a, real b) { return a+b; }
	void main() {
		writeln(плюс(1.61803, 3.14159));
		writeln(1.61803.плюс(3.14159));
	}

Both writeln's print 4.75962. Are you sure you saved your source file in
UTF-8 format?


T

-- 
"I'm not childish; I'm just in touch with the child within!" - RL


More information about the Digitalmars-d-learn mailing list