Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Dict : Accessing items with bracket, like an array or object

未关闭
#8,163 3 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@zth 已经在做这个了。

开始于 2026年4月19日。

评估

这个 Issue 还没有评估数据。

描述

For adict{}, we can access a value only by using Dict.get

let d = dict{"A": 5, "B": 6, "C": 7}

let a = d->Dict.get("A")

The goal is to also using a bracket syntax, like with arrays or objects (without removing Dict.get, just like Array.get and Object.get still exist)

let d = dict{"A": 5, "B": 6, "C": 7}

let a = d["A"]

This would allow some bindings to use dict{} instead of {..} while keeping the same ease of access to values.


The next step could be variable keys but I created this feature request to propose a smaller step that can already be really useful, without having to wait for variable keys.

主要语言
OCaml
星标
7.5k
派生
485
平均合并
1 天 2 小时
30 天内合并 PR
55

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rescript-lang/rescript 的其他 Issue

查看 rescript-lang/rescript 的全部 Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。