Unicode operators
Thomas Moran
no at spam.plx
Wed Oct 22 18:01:50 PDT 2008
I usually lurk here but I wanted to weigh in and say I think this would
be a great thing. It's depressing to see people worrying about whether
"." or "!" is more appropriate for a particular operator when the real
problem is that a different symbol is required. Mathematicians have no
qualms about using 5 different alphabets and 10 kinds of brackets to
describe things, and there's no fundamental reason computer programs
should be any different, except for the fact that entering the symbols
is awkward. Hopefully that will change. I know there's been at least one
font in Windows since win2k that has glyphs for the whole Basic
Multilingual Plane, and there are a lot more that support at least the
greek alphabet and some extended punctuation. I'm sure the situation is
similar in Linux.
Since C++ permits unicode identifiers I actually did some experiments a
few months ago to see what the compiler support was like. The conclusion
was that only MSVC9 can deal with them, GCC4 and ICC10 (EDG I suppose)
both choked. You can actually call a variable "αβγ" in VC9 and the
program compiles. There's unfortunately some confusion over whether
UTF-8 encoded files should have a BOM - MSVC doesn't parse them properly
if they don't, but GCC chokes on the BOM. I think this would have to be
either specified or handled flexibly in D front ends.
More information about the Digitalmars-d
mailing list