August 06, 2004
In article <ceu2eq$21vs$1@digitaldaemon.com>, Lars Ivar Igesund says...

>Well, what I did, was to add characters from the list as part of identifiers, but dmd didn't accept them. It is possible that the file wasn't saved in the correct format, but it didn't look like the problem. I might look at again later when I have something to test.

I know a little about Unicode, but far less about compilers, and pretty much nothing at all about the D compiler. I'm afraid this question will have to be answered by someone else.

J C Calvarses said 'I think when he [Walter] mentioned "Unicode Alpha", he meant "UniversalAlpha".'

If this is true, it would seem strange (to me). It would imply that non-ASCII-digits are allowed as the first character of an identifier. Not that that's necessarily a /bad/ thing - just unexpected.

Jill


August 06, 2004
In article <cevaqt$2u57$1@digitaldaemon.com>, Arcane Jill says...
>
>In article <ceu2eq$21vs$1@digitaldaemon.com>, Lars Ivar Igesund says...
>
>>Well, what I did, was to add characters from the list as part of identifiers, but dmd didn't accept them. It is possible that the file wasn't saved in the correct format, but it didn't look like the problem. I might look at again later when I have something to test.
>
>I know a little about Unicode, but far less about compilers, and pretty much nothing at all about the D compiler. I'm afraid this question will have to be answered by someone else.
>
>J C Calvarses said 'I think when he [Walter] mentioned "Unicode Alpha", he meant "UniversalAlpha".'
>
>If this is true, it would seem strange (to me). It would imply that non-ASCII-digits are allowed as the first character of an identifier. Not that that's necessarily a /bad/ thing - just unexpected.
>
>Jill

(Did you happen to scroll down to my example in http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/8333?)

It's definitely allowed. I was able to use a _Chinese character_ as an identifier. It was the first character. It was the last character. It was the only character.

I can upload the example to my web site if you can't get the example from the post.

jcc7
August 06, 2004
"Arcane Jill" <Arcane_member@pathlink.com> skrev i en meddelelse news:cevaqt$2u57$1@digitaldaemon.com...
> If this is true, it would seem strange (to me). It would imply that non-ASCII-digits are allowed as the first character of an identifier. Not
that
> that's necessarily a /bad/ thing - just unexpected.

C allows it, and so must D to be link-compatible. The relevant C grammar is:

identifier:
    identifier-nondigit
    identifier identifier-nondigit
    identifier digit

identifier-nondigit:
    nondigit
    universal-character-name
    other implementation-defined characters

universal-character-name:
    \u hex-quad
    \U hex-quad hex-quad

hex-quad:
    hexadecimal-digit hexadecimal-digit  hexadecimal-digit hexadecimal-digit

Constraints
A universal character name shall not specify a character short identifier in
the range 00000000 through 00000020, 0000007F through 0000009F, or 0000D800
through 0000DFFF inclusive. A universal character name shall not designate a
character in the required character set.

Description
Universal character names may be used in identifiers, character constants,
and string literals to designate characters that are not in the required
character set.

Semantics
The universal character name \Unnnnnnnn designates the character whose
character short identifier (as specified by ISO/IEC 10646) is nnnnnnnn.
Similarly, the universal character name \unnnn designates the character
whose character short identifier is 0000nnnn.


Regards,
Martin M. Pedersen


August 06, 2004
"Lars Ivar Igesund" <larsivar@igesund.net> wrote in message news:ceu2eq$21vs$1@digitaldaemon.com...
> Walter, obvious bug in documentation has been found. A fix would be received with joyous celebrations across the globe (or at least in an axis between me and Jill). And a clarification in this thread :)

I'll fix it.


1 2
Next ›   Last »