JuliaLang/julia

make KeyIterator and ValueIterator more array-like

オープン

#10,092 opened on 2015/02/05

 (9 件のコメント) (3 件のリアクション) (0 人の担当者)Julia (5,773 件のフォーク)batch import
collectionshelp wanted

Repository metrics

Stars
 (48,709 個のスター)
PR merge metrics
 (平均マージ 20d 6h) (30d で 157 merged PRs)

説明

When have d = Dict(:foo => 12.34, "bar" => 567) and you write keys(d) you get a Base.KeyIterator object, which is fast and cheap to construct from the dictionary d. You can write collect(keys(d)) to get an array of keys, but you have to do this unfortunately often. It would be a good self-contained project to add more array-like behaviors to KeyIterator and the corresponding ValueIterator types so that things like keys(d)[1] and values(d)[end] work as expected.

コントリビューターガイド