• 如何评价网易国产动作冒险单机新作《归唐》首支预告片?
  • 为什么姚明当篮协***,反而男篮的成绩变差了?
  • 为什么现在的00后好像什么都看透了?
  • 姜文新片《你行!你上!》定档 7 月 25 日上映并发布首支预告,从中能获取哪些信息?你会去看吗?
  • 为什么韩国的热辣舞团无法征服中国的男性市场??

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

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

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

发布时间:2025-06-20 19:00:16

分享到:

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

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

上一篇 : 美国很多地方废弃,为啥很多人宁可在街上流浪,也没有人去开荒种地呢?

下一篇 : 宠物看到一丝不挂的你, 都会想些啥?