当前位置: 首页 >

正文

大部分语言都用尖括号<>表示泛型,为什么golang要标新立异用中括号?

最新的设计文档里面对这一块做了一个解释。

Why not use the syntax F like C++ and J***a? When parsing code within a function, such as v := F, at the point of seeing the < it's ambiguous whether we are seeing a type instantiation or an expression using the < operator. This is very difficult to resolve without type information. For example, consider a statement like a, b = w < x, y > (z) Withou…。

大部分语言都用尖括号<>表示泛型,为什么golang要标新立异用中括号?

2025-06-18 09:40:13浏览:99次
电话:
客服QQ:
邮箱:
因为伊朗可能误打误撞打到以色列的根儿上了。 以色列的士兵不
nodejs全栈,感触最深的是:开发人员心智负担实在太大了,
业务远比用什么程序语言重要。 我只想说,互联网上现在99%
我看过钱老的《工程控制论》。 这本书虽然只有300多页。
查看所有文章