网站地图官方微信:
网站首页 杜家镇 威家镇 棠华乡 华阁镇 干海乡 石川乡

当前位置: 首页 >

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

  • | 以色列为什么要打伊朗? |

    以色列这不叫打伊朗,以色列这叫梭哈如果以色列就暗杀一个科学家...

    查看详情>>
  • | 买 iPad 用来打游戏看电影画画买 128GB 还是 256GB ? |

  • | Swift 和同时代的其他语言比起来怎么样? |

  • | 亚克力鱼缸这么容易模糊吗? |

  • | 福州人口流出为什么这么严重? |

  • | 什么是 5G 固定无线接入(FWA)? |

  • | 有什么好用的安卓本地音乐播放器推荐? |

  • | 为什么都说 Finder 难用? |

  • | 面试中被嘲笑Token放在redis里,该如何应对这种情况呢? |

  • | 有一个乌克兰的朋友问我,中国人凭什么能享受和平,我该怎么说? |

  • | 1GB的***每一帧都截图下来,照片有多少GB? |

  • 其实吧,破局的方法也很简单: 这是伊朗导弹上掉下来的火箭...

    2025-06-21
  • 如果你还用OSX系统,哪怕只是9年前的版本,市面上也几乎没有...

    2025-06-21
  • 你没理解这句话 这是微软(曾经) 这是苹果 这是...

    2025-06-21
  • 团队 code review 时,一位同事把 count(*...

    2025-06-21

关注我们

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