网站地图官方微信:
网站首页 沾尚镇 涂寨镇 芦芝镇 咸丰县 咸塘镇 旭日乡

当前位置: 首页 >

大部分语言都用尖括号<>表示泛型,为什么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要标新立异用中括号?

  • | Rust 的设计缺陷是什么? |

    刚看上一个大佬回答的评论区,我认为其实Rust最核心的设计缺...

    查看详情>>
  • | 为什么 macOS 并不差,可市场总敌不过 Windows? |

  • | 空战的时候可不可以先击落预警机? |

  • | 新疆维吾尔自治区,经济发展的真实前景如何? |

  • | 慈禧为什么要反对戊戌变法? |

  • | 特朗普大力推行稳定币,背后的真实目的是什么? |

  • | postgres集群的选择? |

  • | 为什么不趁以色列美国与伊朗打的火热的时机收复台湾呢? |

  • | 送外卖有多累? |

  • | 商业史上有哪些降维打击的经典案例? |

  • | 异性同办公室久了会不会日久生情? |

  • 安卓的命名就比较有规律,除了第一版可能是正好手上有个小蛋糕随...

    2025-06-20
  • 11月3日更新: 听取建议,逐渐缩减VM,转移到CT当中,然...

    2025-06-20
  • 11月3日更新: 听取建议,逐渐缩减VM,转移到CT当中,然...

    2025-06-20
  • 就不想用rust吗?局面打开,j***a写一堆class太臃...

    2025-06-20

关注我们

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