• 如何看待我国在墨脱建水电站?
  • 为什么小米不是用玄戒o1而是用骁***gen3作为小米yu7的座舱芯片呢?
  • 同样是j***ascript, 为什么做成jScript.net就没落了, 连微软都不支持, 而做成node.js就风靡全球?
  • 如何看待我国在墨脱建水电站?
  • 前端如何设计网页?

诚信为本,市场在变,诚信永远不变...        

0896-98589990
新闻资讯
您的当前位置: 首页 > 新闻资讯

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

发布时间:2025-06-22 20:30:10

分享到:

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

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要标新立异用中括号?

上一篇 : 通过 GraalVM 将 J***a 程序编译成本地机器码后,效率能和rust比吗?

下一篇 : 有人说我们中国领先了两千多年一直到满清才落后的。你怎么看?