3 ms·
If it were up to me, anything outside the basic character set in a source file would be a syntax error, I'm simply reporting what the spec says.
by qsort 1y ago
If it were up to me, anything outside the basic character set in a source file would be a syntax error, I'm simply reporting what the spec says.
- ncruces 1y agoI use unicode for math in comments, and think makes certain complicated formulas far more readable.
- kzrdude 1y agoI've just been learning pinyin notation, so now i think the variable řₚ should have a value that first goes down a bit and then up.
- zelphirkalt 1y agoI am not sure it is a good idea to mix such specific phonetic script ideas about diacritic marks with the behavior of the program over time. Even considering the shape, it does not align with the idea of first down a little, then up a lot.
- kzrdude 1y agoTo be sure, it's a joke. Mostly trying to joke at the expense of these excessively complicated variable names (that are only there because it's pseudocode) :) And yeah, the chinese tone in practice does not align with the idea of "down a little up a lot" either. It depends on context...
- guipsp 1y agoWhat a "basic character set" is depends on locale
- qsort 1y agohttps://en.cppreference.com/w/c/language/charset.html https://en.cppreference.com/w/c/language/charset.html
- account42 1y agoAnything except US-ASCII in source code outside comments and string constants should be a syntax error.
- guipsp 1y agoYou are aware other languages exist? Some of which don't even use the Latin script?
- Y_Y 1y agoWhat; like APL‽
- nottorp 1y agoDunno about the OP but I'm very aware as I'm not an english speaker. I still don't want anything as unpredictable as Unicode in my code. How many different encodings will display as the same variable name and how is the compiler supposed to decide? If you're thinking of comments and user facing strings, the OP already excluded those.
- cryptonector 1y agoThe language and compiler & linker should reject Zalgo in identifiers, and they should reject confusable script mixes in identifiers, but otherwise they treat all equivalent strings as equivalent. To make it easier on the linker compilers should normalize all symbols to one common form (e.g., NFC).
- account42 1y agoAnd those are not programming languages, or at least not the C programming language which only needs a very limited character set.
- steveklabnik 1y agoC does allow for limited unicode in identifiers, though you need to use the \u prefix and write the code out. Compilers like clang let it work like C++ and follow TR31, though this is nonstandard.