Go 2 Generics? A (P)review
generic(t) func .. ○ $t // 使用类型参数 ○ t // 实例化具体类型 评述 ● 确实是一个糟糕的设计 ● x := Vector(t)(v0) 这是两个函数调用吗? ● 尝试借用使用 C++ 的 Concepts 对类型参数的约束 1 type Greater(t) interface { 2 IsGreaterThan(t) bool 3 } 4 5 func0 码力 | 41 页 | 770.62 KB | 1 年前3Go 101 (Golang 101) v1.21.0
DoSomething VERSION Ĝo Π Here are some legal non-exported identifiers: _ _status memStat book π 一个类型 변수 エラー And here are some tokens which are illegal to be used as identifiers: // Starting with a Unicode digit0 码力 | 610 页 | 945.17 KB | 1 年前3Go 101 (Golang 101) v1.21.0
some legal non-exported identifiers: 1| _ 2| _status 3| memStat 4| book 5| π 6| 一个类型 7| 변수 8| エラー And here are some tokens which are illegal to be used as identifiers: 1| // Starting with a Unicode0 码力 | 880 页 | 833.34 KB | 1 年前3Go 101 (Golang 101) v1.21.0
legal non-exported identifiers: 1| _ 2| _status 3| memStat 4| book 5| π 6| 一个类型 7| 변수 8| エラー And here are some tokens which are illegal to be used as identifiers: 1| // Starting with a Unicode0 码力 | 630 页 | 3.77 MB | 1 年前3Golang 101(Go语言101 中文版) v1.21.a
VERSION 4| Ĝo 5| Π 下面是一些合法的未导出标识符: 1| _ 2| _status 3| memStat 4| book 5| π 6| 一个类型 7| 변수 8| エラー 下面这些不能被用做标识符: 1| // Unicode数字开头 2| 123 3| 3apples 4| 5| // 含有不符合要求的Unicode字符 6| a.b 7| *ptr 8|0 码力 | 821 页 | 956.82 KB | 1 年前3Golang 101(Go语言101 中文版) v1.21.a
下面是一些合法的导出标识符: Player_9 DoSomething VERSION Ĝo Π 下面是一些合法的未导出标识符: _ _status memStat book π 一个类型 변수 エラー 下面这些不能被用做标识符: // Unicode数字开头 123 3apples // 含有不符合要求的Unicode字符 a.b *ptr $name a@b.c // 这两个是关键字0 码力 | 608 页 | 1.08 MB | 1 年前3Golang 101(Go语言101 中文版) v1.21.a
4| Ĝo 5| Π 下面是一些合法的未导出标识符: 1| _ 2| _status 3| memStat 4| book 5| π 6| 一个类型 7| 변수 8| エラー 下面这些不能被用做标识符: 1| // Unicode数字开头 2| 123 3| 3apples 4| 5| // 含有不符合要求的Unicode字符 6| a.b 7|0 码力 | 591 页 | 21.40 MB | 1 年前3
共 7 条
- 1