Dict : Accessing items with bracket, like an array or object
@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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rescript-lang/rescript 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
rescript-lang/rescript#8659 · 2 条评论 · 2 个 reaction ·
-
难度 5/5 一周以上 新手友好度 35/100
rescript-lang/rescript#8647 ·
-
rescript-lang/rescript#8632 · 已指派 1 人 ·
-
难度 5/5 一周以上 新手友好度 28/100
rescript-lang/rescript#8624 ·
-
难度 5/5 一周以上 新手友好度 30/100
rescript-lang/rescript#8596 · 2 条评论 ·