我国的军工能力可以实现一天5000枚火箭弹连着炸三个月吗?
为什么同样是输球,常州和国足的风评却差那么多呢?
为什么水泥封不住尸臭?
为何雷军天天健身,却无健身痕迹?
群晖端部署了emby,盒子安装了客户端播放蓝光电影为什么不能显示影片自带字幕?
为什么中国电信的iptv一定要有网线连接!?

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

发布日期:2025-06-27 20:55:11 浏览次数:0

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

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