4 ms·
2. The language is in UTF-8 so you can have snowman variable names but weirdly what gets exported from a struct or package and what doesn't is decided by upperc
by kibwen 14y ago
2. The language is in UTF-8 so you can have snowman variable names but weirdly what gets exported from a struct or package and what doesn't is decided by uppercase/lowercase (respectively).
I knew that Go was both case-significant and Unicode-aware, but I had assumed (perhaps incorrectly) that they'd have some mechanism to export identifiers written in scripts that don't have a case distinction. Can anyone verify this? Or do they really expect e.g. Japanese programmers to write identifiers like `A緑` instead of `緑`?
- mseepgood 14y agoWriting non-English identifiers in a programming language that is based on English keywords seems wrong to me anyway. I'm not an English native speaker myself, but I accept that the international language of programming and source code is English.
- kibwen 14y agoEnglish is my only natural language, so I don't feel qualified to comment on whether or not this is attitude is acceptable in circles where English is not the native tongue. But from a language design standpoint, why even allow Unicode identifiers if you're going to foist ASCII on everyone anyway? EDIT: Actually, I suppose Unicode-awareness means that they'd be foisting Unicode Category Lu[1] on everyone rather than simply ASCII. [1] http://www.fileformat.info/info/unicode/category/Lu/list.htm http://www.fileformat.info/info/unicode/category/Lu/list.htm
- masklinn 14y ago> Writing non-English identifiers in a programming language that is based on English keywords seems wrong to me anyway. Then it should not be allowed at all. Language users will find a way though, they can just write phonetically.
- pcwalton 14y agoThe standard idiom in Go is X緑, I believe.