December 05, 2003 Re: [OT] UNICODE operators | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mark J. Brudnak | Agreed, though I would like to use symbols as operators. Sean "Mark J. Brudnak" <mjbrudna@oakland.edu> wrote in message news:bqq0pe$183n$1@digitaldaemon.com... > I think only "letter-like" unicode characters should be allowed in D identifiers. Having variables like > > int  = 42 ; > float ±×§ =3.14159 ; > > will really confuse things. Punctuation, shapes, boxdrawing, dingbats, math > symbols, should be prohibited from being used in identifiers. |
December 05, 2003 Re: [OT] UNICODE operators | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer Attachments: | Sean L. Palmer wrote: > Yeah, just have to set this "free" browser to Encoding... Unicode UTF-8 OK, so I didn't send it right. (That's what a WASP like me gets for belittling ASCII.) Unicode isn't very friendly to novices. I think putting it in a .zip will help out. Maybe it will work if I turn it into an .html file. I'm sure there's a setting in Thunderbird that will take care of this stuff automatically; I'm just not sure how much time I want to spent looking for it. (By the way, I used WinXP's notepad to create the original document because I was lazy and didn't want to hunt down another Unicode-capable editor.) Justin > > That's pretty cool. Pretty cool indeed. > > I bet you if I cut and paste some D program made by someone is a far-away land, into some web-based translator engine it would probably not do that bad of a job of translating the identifiers back into english again ;) > > Most likely, I'll rarely if ever see any source written in some other language, and if I did, I'd just consider it obfuscation. It's not a sin punishable by death. > > I think it's cool that finally people can more or less program in their own language, once they learn the english keywords. A preprocessor would allow even those to be replaced. > > In fact, whose idea was it to allow infix notation for regular identifiers? We could use a preprocessor to translate our D + Unicode Symbols into D that will actually compile. ;) Right now it would only work with prefix (lisp-like) notation, however. > > They have some really interesting brackets in Unicode, as well. Surely there's one just begging to be used for template syntax. > > Sean > > "J C Calvarese" <jcc7@cox.net> wrote in message news:bqpbqo$8no$1@digitaldaemon.com... > >>Sean L. Palmer wrote: >> >>>That's fine with me, so long as they are not expressly prohibited, I can > > use > >>>them for my own personal projects. Support for them would then grow grassroots-style. I have text editors that support Unicode, and I don't mind cutting and pasting. Ease of entry is a minor issue to me. >>> >>>The problem is, if we can't define new operators in D, and it doesn't provide enough overloadable builtin operators, I'm stuck. I can do > > nothing > >>>but invest in a Unicode-aware preprocessor. I want the option of moving forward. >>> >>>What good is being able to compile D source encoded in UTF-8 if you > > aren't > >>>allowed to use any symbols that aren't in ASCII? (except embedded in > > string > >>>literals) >> >>Actually, since DMD 0.74 non-ASCII characters (as long they are "unicode >>alpha") are allowed as identifier names. (See the attached example.) >>Also, comments can contain any non-ASCII character. >> >>I do think Unicode operators is an interesting idea. >> >> >>Justin >> >> >>>Sean >> > > > ---------------------------------------------------------------------------- > ---- > > > >> >>const char[] Sí = "yes"; >>const char[] Año = "year"; >> >>/+ >> >>These don't work (it might be because they are iconic symbols rather than > > part of any actual language) > >>const char[] ???? = "box drawing"; >>const char[] ???? = "cards"; >> >>+/ >> >> >>int main() >>{ >> >> int AñoNúmero = 2003; >> int Cyrillic???? = 1; >> int Hebrew?????; >> >> printf("%d", AñoNúmero); >> >> return 0; >>} > > > |
December 05, 2003 Re: [OT] UNICODE operators | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mark J. Brudnak | Mark J. Brudnak wrote:
> "J C Calvarese" <jcc7@cox.net> wrote
>
>
> <snip>
>
>>Actually, since DMD 0.74 non-ASCII characters (as long they are "unicode
>>alpha") are allowed as identifier names. (See the attached example.)
>>Also, comments can contain any non-ASCII character.
>>
>
>
> I think only "letter-like" unicode characters should be allowed in D
> identifiers. Having variables like
>
> int  = 42 ;
> float ±×§ =3.14159 ;
>
> will really confuse things. Punctuation, shapes, boxdrawing, dingbats, math
> symbols, should be prohibited from being used in identifiers.
>
>
My mail program garbled the UTF-8 file that I was trying to use as an example.
D only allows unicode alphas (A - Z, alpha - omega, aleph - taw, accented letters, etc.)
For example, the cards symbols (♠♥♣♦) and box elements (╠╢╦╬) can't be used as identifiers (I'm sure because I tried them and it wouldn't compile).
Justin
|
December 20, 2003 Re: UNICODE operators | ||||
---|---|---|---|---|
| ||||
Posted in reply to Hauke Duden | "Hauke Duden" <H.NS.Duden@gmx.net> wrote in message news:bqnr2q$1240$1@digitaldaemon.com... > Creating Unicode applications in D is a completely different thing (and it was/is already discussed in a different thread). I agree. D should fully support developing unicode apps. I should point out, though, that right now D supports unicode source text (UTF-8, UTF-16, and UTF-32), unicode characters in comments and strings, and unicode alpha characters in identifiers. I'm not sure, though, if the world is quite ready yet for unicode operators. We'll see. |
December 20, 2003 Re: [OT] UNICODE operators | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mark J. Brudnak | "Mark J. Brudnak" <mjbrudna@oakland.edu> wrote in message news:bqq0pe$183n$1@digitaldaemon.com... > I think only "letter-like" unicode characters should be allowed in D identifiers. You're right, and that's the way it works now. I'm going by the C98 "Appendix D" list of allowed alpha characters. |
Copyright © 1999-2021 by the D Language Foundation