SpaceX 星舰 36 号火箭静态点火测试爆炸,爆炸的原因是什么?会对星舰发展产生什么影响?
现在学习QT,还有前途吗?
颈椎生理曲度变直如何恢复?
Redis 分布式锁如何实现?
养鱼先晾水,我晾了很久的清水去换水时,发现居然全发霉了,想不明白,求解?
中医把脉是***吗?

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

发布日期:2025-06-21 23:00:17 浏览次数: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要标新立异用中括号?