当前位置: 首页 >

正文

大部分语言都用尖括号<>表示泛型,为什么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-19 19:25:11浏览:99次
电话:
客服QQ:
邮箱:
之前回答过类似问题,当初我就吐槽过知乎某些人左右横跳颠倒黑白
新西兰目前的it就业市场是这样 平均一个岗位1,00
攻击长相是最没意义的。 这个姑娘无论如何也是高于平均水平。
“雷”是因为缺乏意义。 当穿越的功用仅仅停留在为现代爱情寻求
查看所有文章