Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
33d10e4d
Commit
33d10e4d
authored
Nov 17, 2009
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explain the situation with unicode and identifiers
R=rsc CC=golang-dev
https://golang.org/cl/156044
parent
26b55e44
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
go_lang_faq.html
doc/go_lang_faq.html
+27
-0
No files found.
doc/go_lang_faq.html
View file @
33d10e4d
...
...
@@ -201,6 +201,33 @@ Finally, concurrency aside, garbage collection makes interfaces
simpler because they don't need to specify how memory is managed across them.
</p>
<h2
id=
"unicode_identifiers"
>
What's up with Unicode identifiers?
</h2>
<p>
It was important to us to extend the space of identifiers from the
confines of ASCII. Go's rule
—
identifier characters must be
letters or digits as defined by Unicode
—
is simple to understand
and to implement but has restrictions. Combining characters are
excluded by design, for instance.
Until there
is an agreed external definition of what an identifier might be,
plus a definition of canonicalization of identifiers that guarantees
no ambiguity, it seemed better to keep combining characters out of
the mix. Thus we have a simple rule that can be expanded later
without breaking programs, one that avoids bugs that would surely arise
from a rule that admits ambiguous identifiers.
</p>
<p>
On a related note, since an exported identifier must begin with an
upper-case letter, identifiers created from
“
letters
”
in some languages can, by definition, not be exported. For now the
only solution is to use something like
<code>
X日本語
</code>
, which
is clearly unsatisfactory; we are considering other options. The
case-for-visibility rule is unlikely to change however; it's one
of our favorite features of Go.
</p>
<h2
id=
"absent_features"
>
Absent features
</h2>
<h3
id=
"generics"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment