┌──────────────┬────────────┬───────────────────────┐
│ Keyword List │ Map/Struct │ HashDict (deprecated) │
┌──────────────────┼──────────────┼────────────┼───────────────────────┤
│ Duplicate keys │ yes │ no │ no │
│ Ordered │ yes │ no │ no │
│ Pattern matching │ yes │ yes │ no │
│ Performance¹ │ — │ — │ — │
│ ├ Insert │ very fast² │ fast³ │ fast⁴ │
│ └ Access │ slow⁵ │ fast³ │ fast⁴ │
└──────────────────┴──────────────┴────────────┴───────────────────────┘
elixir keyword和map的区别
猜你喜欢
转载自my.oschina.net/u/855913/blog/2876573
今日推荐
周排行