当前位置: 首页 >

正文

大部分语言都用尖括号<>表示泛型,为什么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-23 05:20:09浏览:99次
电话:
客服QQ:
邮箱:
曾经你在电视机上看过的电视剧, 现在全世界可能不到10个人拥
看到这个问题特意去查了下什么是KVM显示器。 不需要。
前两年有个电影叫……皮囊之下 话说评分还是很高的,这里面
微软周一宣布,将在欧洲停止目前Microsoft Edge的
查看所有文章