当前位置: 首页 >

正文

大部分语言都用尖括号<>表示泛型,为什么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 18:30:15浏览:99次
电话:
客服QQ:
邮箱:
所以前几年为什么要禁挖矿?本来国内几乎占据全球一半算力,拱手
这是我基于rust写的一款作业调度软件,支持广播执行作业,定
0 前言近期工作接触到 cloudwego 开源的 hert
在2016年,我在做一个网关项目时,需要实现远程固件升级功能
查看所有文章