网站地图官方微信:
网站首页 阅览室桌椅 眼镜架 眼镜及配件 验钞机 学习文具 学生

当前位置: 首页 >

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

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

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

  • | 如何评价苹果 3 月 5 日发布的 MacBook Air M4,相比前代有哪些提升? |

    最近买了M4,蓝色,不说其他,单说颜值,这个主观性很强,我想...

    查看详情>>
  • | systemd吞并了什么? |

  • | Python+rust会是一个强大的组合吗? |

  • | 做个web服务器,gin框架和go-zero怎么选? |

  • | 在山上挖一座不放鱼的池塘,再过100年时间,里面会慢慢有鱼吗? |

  • | 为什么我觉得现在线上大部分都对华为反感,线下华为大卖? |

  • | 为什么中国很少有人使用linux? |

  • | 为什么浙江落下的陨石,防空系统没有拦截,它和导弹有什么不同? |

  • | 你怎么看待iOS26的LiquidGlass液态玻璃? |

  • | 2025年了 Rust前景如何? |

  • | 有一双超级大长腿是什么感觉? |

  • 周杰伦又登上了热搜第一! 最近有网友在日本偶遇周杰伦,在**...

    2025-06-21
  • 买啊,结婚前我说我要买相机,老婆不答应,我就自己买了一个二手...

    2025-06-21
  • 飞牛系统(J3455、16G内存) 容器管理:1Panel或...

    2025-06-21
  • esim方不方便?——方便 方便的东西为什么运营商会主动中断...

    2025-06-21

关注我们

添加微信好友,关注最新动态