Why not extend do to allow unicode in ID's?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Tue Jul 2 02:17:56 UTC 2019


On Saturday, June 29, 2019 4:38:06 PM MDT Bert via Digitalmars-d wrote:
> It would greatly expand the coverage.
>
> It would be nice to use certain characters that are truly
> meaningful.
...

Like most major languages, D supports identifiers with alphanumeric
characters plus underscore with the first character not being allowed to be
numeric. However, unlike most languages, it expands that to include Unicode
alpha characters, meaning that quite a lot of Unicode is supported in
identifiers. So, it already goes far beyond what most languages do.

That being said, I think that you'll find that most folks will not be in
favor of using Unicode in identifiers outside of code intended for people of
a specific language who actually use those characters normally (e.g.
Japanese characters when all of the programmers involved read and write
Japanese and have keyboards that support it). The fact that a character is
not a key on a typical keyboard means that anyone using an identifier with
that charater in it will almost certainly have to copy-paste it, and that's
really not going to over well with most people. If you really feel strongly
about the matter, you can always create a DIP to propose a language change
to allow more Unicode characters in identifiers, but I would not expect it
to be accepted.

- Jonathan M Davis





More information about the Digitalmars-d mailing list