当前位置: 首页 >

正文

大部分语言都用尖括号<>表示泛型,为什么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-20 22:30:16浏览:99次
电话:
客服QQ:
邮箱:
为了做足功课,特地去youtube上听了整个讲话。 鲍威尔
现在B站的推流机制已经逆天到了,一个粉丝个位数的up主随便发
拍个照给你们看,这是我公司隔壁的拳馆。 里面有个泰拳女
泰山架构,八龙基带,灵犀通信,玄武车身,昆仑玻璃,***模型
查看所有文章