January 31, 2003 Re: Bug: Package names cannot start with digit. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | "Sean L. Palmer" <seanpalmer@directvinternet.com> wrote in message news:b1bst9$15nl$1@digitaldaemon.com... > What are the plans for extending identifiers to support Unicode? How far are you willing to go? ;) I don't have any plans to support non-ascii characters for identifiers. The unicode support is for strings and comments. > I *really* want to be able to use the extra math symbols in Unicode as operators. I could give you either a short list or a long list of the ones > I would want. Just allowing any Unicode character that is considered a symbol or mathematical operator would be fine too. That has a much more compelling case for it <g>. > The ones that are most direly needed are > > dot product (U+22C5 although there are several similar symbols) > cross product (U+00D7) > > The reason we need these is that they're ultra common operations that have higher precedence than multiply, meaning none of the available overloadable > operators has the right precedence. > > but it'd also be nice to have: > > division operator (U+00F7) > set union and intersection > set membership > logical operators (and, or, xor, nor, nand, not) > comparison operators (single symbol support for <=, >=, !=, etc plus "almost > equal" for floats) > single symbol support for <<, >> > > And I could go on and on. > > Sean > > ----- Original Message ----- > From: "Walter" <walter@digitalmars.com> > Newsgroups: D > Sent: Wednesday, January 29, 2003 10:40 AM > Subject: Re: Bug: Package names cannot start with digit. > > > > > > "Robert Medeiros" <robert.medeiros@utoronto.ca> wrote in message news:b184a6$srp$1@digitaldaemon.com... > > > As for the gothic 'R' notation: maybe if we get to the point where we > can > > > use UTF-?? for our source files... :) > > > > You can as of 0.51. But identifiers are still ascii. > > > |
January 31, 2003 Re: Bug: Package names cannot start with digit. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | "Sean L. Palmer" <seanpalmer@directvinternet.com> wrote in message news:b1bs19$14ik$1@digitaldaemon.com... > Supposedly DMD 0.51 will read UTF-8 files as input but the lexer doesn't like any characters outside the ascii range and will complain about them. True. Reading the source text is just a starting point, at least so that utf-16, etc., text editors can be used. > Being able to actually overload the cross product and dot product, paragraph, dagger, left contraction symbols as operators would be fantastic! > The little superscript 2 could be Square, of course there's square root symbol, ALL KINDS of good stuff in Unicode for what we need. And it wouldn't have to be hacks, provided the language supported those things being overloaded. Even if the precedence defaulted to the highest possible > it would still be light-years ahead of C++. It would probably have to be the highest precedence. |
February 02, 2003 Re: Bug: Package names cannot start with digit. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Medeiros | In article <b19hn4$21fk$1@digitaldaemon.com>, robert.medeiros@utoronto.ca says... > > > As for the gothic 'R' notation: maybe if we get to the point where we > can > > > use UTF-?? for our source files... :) > > > > You can as of 0.51. But identifiers are still ascii. > > Probably for the best. Otherwise, it would be entertaining for an hour or so to write all my identifiers in, say, Chinese ideographs -- after which it would just be confusing and a maintenance nightmare. Well if the maintainer doesn't read chinese, it prolly would be. But for those who can read chinese that prolly wouldn't be a problem. Hmm makes me wonder how most non-english fluent ppl deal with identifiers. After some looking about in usenet, it seems that non- english language users either just deal with the restrictions of ascii, or write their own hacks to make it so that identifiers can be used in their language (either by preprocessing, or changing the parser). This would seem to a bad way of doing it. > But think of the > obfuscated coding contests that one could win with a "feature" like that... > one could write a veritable program of Babel... :) If I was entering I'd try and do it all with symbols.. :) - Factory |
February 02, 2003 Re: Bug: Package names cannot start with digit. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | "Sean L. Palmer" <seanpalmer@directvinternet.com> wrote in news:b1bs19$14ik$1@digitaldaemon.com: > Supposedly DMD 0.51 will read UTF-8 files as input but the lexer doesn't like any characters outside the ascii range and will complain about them. Being able to actually overload the cross product and dot product, paragraph, dagger, left contraction symbols as operators would be fantastic! The little superscript 2 could be Square, of course there's square root symbol, ALL KINDS of good stuff in Unicode for what we need. And it wouldn't have to be hacks, provided the language supported those things being overloaded. Even if the precedence defaulted to the highest possible it would still be light-years ahead of C++. D would be light-years ahead of C++ ? Stroustrup thought about exploiting unicode for extended overloading in C++, almost five years ago. B Stroustrup: Generalizing Overloading for C++2000. Overload, Issue 25. April 1, 1998 <g> <http://www.research.att.com/~bs/whitespace98.pdf> Farmer. |
February 02, 2003 Re: Bug: Package names cannot start with digit. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Farmer | There's a big difference between "thought about it" and "implemented it". Yeah, I guess that paper was an april fools joke. But some of what's in there could actually be worth pursuing. Sean "Farmer" <itsFarmer.@freenet.de> wrote in message news:Xns9316E669FBA21itsFarmer@63.105.9.61... > D would be light-years ahead of C++ ? > > Stroustrup thought about exploiting unicode for extended overloading in C++, almost five years ago. > > > B Stroustrup: Generalizing Overloading for C++2000. Overload, Issue 25. > April 1, 1998 <g> > <http://www.research.att.com/~bs/whitespace98.pdf> > > > Farmer. |
February 03, 2003 Re: Bug: Package names cannot start with digit. | ||||
---|---|---|---|---|
| ||||
Posted in reply to factory | "factory" <tehdasX@optushome.com.au> escreveu na mensagem news:MPG.18a73d5f6a792070989684@news.digitalmars.com... [snip] > > Well if the maintainer doesn't read chinese, it prolly would be. But > for those who can read chinese that prolly wouldn't be a problem. > Hmm makes me wonder how most non-english fluent ppl deal with > identifiers. After some looking about in usenet, it seems that non- > english language users either just deal with the restrictions of ascii, > or write their own hacks to make it so that identifiers can be used in > their language (either by preprocessing, or changing the parser). > This would seem to a bad way of doing it. > > > But think of the > > obfuscated coding contests that one could win with a "feature" like that... > > one could write a veritable program of Babel... :) > > If I was entering I'd try and do it all with symbols.. :) > > - Factory I'm brazilian and lot's of programmers around here aren't fluent in english. Usually people use plain ascii without any kind of special characters (even in Java), but with portuguese identifiers. Most of our accents (e.g. ~ ` ´) and the "ç" letter are just avoided. So instead of "exceção" (I don't know if it'll be displayed correctly) is written "excecao" and people don't complain ;-) --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.449 / Virus Database: 251 - Release Date: 27/1/2003 |
February 03, 2003 Re: Bug: Package names cannot start with digit. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | "Sean L. Palmer" <seanpalmer@directvinternet.com> escreveu na mensagem news:b1k70j$1fkr$1@digitaldaemon.com... > There's a big difference between "thought about it" and "implemented it". > > Yeah, I guess that paper was an april fools joke. But some of what's in there could actually be worth pursuing. > > Sean > > "Farmer" <itsFarmer.@freenet.de> wrote in message news:Xns9316E669FBA21itsFarmer@63.105.9.61... > > D would be light-years ahead of C++ ? > > > > Stroustrup thought about exploiting unicode for extended overloading in C++, almost five years ago. > > > > > > B Stroustrup: Generalizing Overloading for C++2000. Overload, Issue 25. > > April 1, 1998 <g> > > <http://www.research.att.com/~bs/whitespace98.pdf> > > > > > > Farmer. > IIRC it was indeed a april fool's joke. If not it should, because in some parts he talks about giving the default identifier name length to be just 1 character, and overload the "empty space" operator for ints to be multiplication, so "x=yzw" is "x = y * z * w". I think the idea of using unicode characters for certain operators would be a great idea for code editing, but not for the language. It looks a good idea, but code is usually linear, and I want to write e = mc2 with superscripting instead of lousy power of operators ;-) The same goes for division or linear algebra. Maybe D could always associate a operator with an operation, even for new operators, and IDE's could make use of this: // default operators alias '+' add; alias '*' mul; // my module operators alias "unicode for cross product goes here" cross; or even allowing per-module aliasing of operators. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.449 / Virus Database: 251 - Release Date: 27/1/2003 |
February 03, 2003 Re: Bug: Package names cannot start with digit. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Yokomiso | Daniel Yokomiso wrote: > "factory" <tehdasX@optushome.com.au> escreveu na mensagem > news:MPG.18a73d5f6a792070989684@news.digitalmars.com... > > [snip] > > >> Well if the maintainer doesn't read chinese, it prolly would be. But >>for those who can read chinese that prolly wouldn't be a problem. >> Hmm makes me wonder how most non-english fluent ppl deal with >>identifiers. After some looking about in usenet, it seems that non- >>english language users either just deal with the restrictions of ascii, >>or write their own hacks to make it so that identifiers can be used in >>their language (either by preprocessing, or changing the parser). >> This would seem to a bad way of doing it. >> People which can't get even a couple of words in English right are a major plague in any SW development: - english thesis/documents have to be read and worked into software to make it modern and efficient: Even the japanese who are "systematically taught in school to hate english" prefer english for scientific work. - many people aren't able to switch between languages. I'm fluent with english, german, and russian, and understand another couple more, but i always get headaches when i see laguages mixed together. Language keywords are english, identifiers are german (some of them). Horrible, it slows me down reading the code by a factor of at least 2. Someone was irritated here at first, when i in my home assignment have renamed each and every identifier into english, and also wrote all of my comments in english as well. I work a lot with finnish guys, imagine what a catastrophe it would be if they would write comments in finnish, or i in german/russian/whatever... I thow away any piece of source, which contains russian, even though i could read it. My editor can't. :> BTW, i hope you excuse me that i use capitals in text very sparigly, but i'm really fed up with them, since in german every noun is capitalised. My capitalization threshold is being eaten up by both that and programming. >> >>>But think of the >>>obfuscated coding contests that one could win with a "feature" like >>>that... D is not for obfuscation. What i have always liked about Delphi, is that foreign code is almost like mine, so i had no major reading problems. D was intended to have the same advantage. > I'm brazilian and lot's of programmers around here aren't fluent in english. > Usually people use plain ascii without any kind of special characters (even > in Java), but with portuguese identifiers. Most of our accents (e.g. ~ ` ´) > and the "ç" letter are just avoided. So instead of "exceção" (I don't know > if it'll be displayed correctly) is written "excecao" and people don't > complain ;-) Most russian programmers are also used to write with ASCII. They call it "Volapyuk encoding". Russian has a completely different set of letters, which is also by about 10 larger than latin, and lies completely in "bit 7 set" area. -i. |
February 03, 2003 Re: Bug: Package names cannot start with digit. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Minkov | Ilya Minkov wrote:
>> I'm brazilian and lot's of programmers around here aren't fluent in english.
>> Usually people use plain ascii without any kind of special characters (even
>> in Java), but with portuguese identifiers. Most of our accents (e.g. ~ ` ´)
>> and the "ç" letter are just avoided. So instead of "exceção" (I don't know
>> if it'll be displayed correctly) is written "excecao" and people don't
>> complain ;-)
>
>
> Most russian programmers are also used to write with ASCII. They call it "Volapyuk encoding". Russian has a completely different set of letters, which is also by about 10 larger than latin, and lies completely in "bit 7 set" area.
I've been working in the Czech Republic, and they do the same thing that Daniel was talking about. just write the word without any of the diacritical marks. It can get really confusing if you're not a native speaker, since the diacriticals disambiguate the words a lot. You get a feeling for it after a while, but wow, can it be a pain in the ass to parse.
Evan
|
February 04, 2003 Re: Bug: Package names cannot start with digit. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Yokomiso | "Daniel Yokomiso" <daniel_yokomiso@yahoo.com.br> wrote in message news:b1kf9f$1k2l$1@digitaldaemon.com... > I'm brazilian and lot's of programmers around here aren't fluent in english. > Usually people use plain ascii without any kind of special characters (even > in Java), but with portuguese identifiers. Most of our accents (e.g. ~ ` ´) > and the "ç" letter are just avoided. So instead of "exceção" (I don't know if it'll be displayed correctly) is written "excecao" and people don't complain ;-) Well, wouldn't it be nice if you could just program with Portuguese identifiers? Sure, you'd have to learn the English D keywords (or use a preprocessor to translate those too) I would estimate that at least 50% of all the programs that are made are never seen by anyone but their maker. Little test apps and such. If you don't like accented characters, you could always have a policy against using them. I think it's a nice option though for non-native-English-speakers, and as a nice aside it gets the Unicode ball rolling. ;) Sean |
Copyright © 1999-2021 by the D Language Foundation