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

Views :
Update time : 2025-06-26 09:25:13

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

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 空输部队为全斗焕干了这么多脏活累活,士兵有没有什么优待?
2025-06-22 07:10:10
空输部队为全斗焕干了这么多脏活累活,士兵有没有什么优待?...
Blog Post With Youtube Video 鸿蒙电脑应用开发和鸿蒙手机是一样的吗?
2025-06-22 06:45:10
鸿蒙电脑应用开发和鸿蒙手机是一样的吗?...
Blog Post With Youtube Video 5 月 28 日 DeepSeek R1 模型完成小版本试升级并开源,具体有哪些提升?使用体验如何?
2025-06-22 05:45:09
5 月 28 日 DeepSeek R1 模型完成小版本试升级并开源,具体有哪些提升?使用体验如何?...
Blog Post With Youtube Video 想学编程,该不该买MacBook?
2025-06-22 06:05:09
想学编程,该不该买MacBook?...

Leave Your Message