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

Views :
Update time : 2025-06-23 21:50:11

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

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要标新立异用中括号?
Related News
Read More >>
Blog Post With Youtube Video 印度GDP世界排名只落后中国二十年,为什么城市建设看起来却远不如当年的中国?
2025-06-21 13:05:13
印度GDP世界排名只落后中国二十年,为什么城市建设看起来却远不如当年的中国?...
Blog Post With Youtube Video 《诛仙》中有哪些捧腹大笑的剧情?
2025-06-21 11:55:11
《诛仙》中有哪些捧腹大笑的剧情?...
Blog Post With Youtube Video notion和Obsidian这两款软件选哪个?
2025-06-21 12:45:11
notion和Obsidian这两款软件选哪个?...
Blog Post With Youtube Video 王健林再卖 48 座万达广场,会对万达集团带来哪些影响?目前万达面临怎样的困境?
2025-06-21 11:55:11
王健林再卖 48 座万达广场,会对万达集团带来哪些影响?目前万达面临怎样的困境?...

Leave Your Message