网站地图官方微信:
网站首页 望都镇 程委镇 岭头乡 胶州市 石黄镇 旌阳区

当前位置: 首页 >

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

  • | FVCOM这个软件怎么样呢? |

    FVCOM初识--基础详细教程 FVCOM初识--基础详细教...

    查看详情>>
  • | 为什么 Windows 没有比较成熟的第三方桌面环境(explorer.exe)? |

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

  • | 女生腰肌劳损了还能健身吗? |

  • | 为什么没有核动力货轮? |

  • | 2029年中国能载人登上月球吗? |

  • | 为什么在日本是实体店干掉电商,在中国却是电商干掉实体? |

  • | NAS的盘是否需要一次性买齐? |

  • | 中年夫妻有多少是生活和谐的? |

  • | postgres集群的选择? |

  • | 前端想要学习后端,选择哪种语言好一点? |

  • 能 很多很多年之前,我单身的时候,买了一副超级巨大的美女海报...

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

    2025-06-23
  • 一个自然语言生成K8s配置文件开源工具:kubectl-ai...

    2025-06-23
  • 看的你的作品第一眼,就知道你没系统的学过设计,或者设计基础很...

    2025-06-23

关注我们

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