一:array:可以和list , orddict相互转化, 它的好处是像数组一样可以按照顺序获取第几个值
二:proplists
DESCRIPTION
Property lists are ordinary lists containing entries in the form of either tuples, whose first elements are keys used for lookup and insertion, or atoms, which work as shorthand for tuples {Atom, true}. (Other terms are allowed in the lists, but are ignored by this module.) If there is more than one entry in a list for a certain key, the first occurrence normally overrides any later (irrespective of the arity of the tuples).
Property lists are useful for representing inherited properties, such as options passed to a function where a user may specify options overriding the default settings, object properties, annotations, etc.
Two keys are considered equal if they match (=:=). In other words, numbers are compared literally rather than by value, so that, for instance, 1 and 1.0 are different keys.
proplists 是一个列表, 列表中的元素可以是{K, V} 元组,也可以是压缩版的原子代表{K, true},
也可以用unfold 打开呈现出来!
当然如果是这种类型的还可以用proplists:compact 压缩成原子形式
其他类型的就会被忽视了,如
proplists:get_value(b, [{a, 1}, [b,b,b]]).
undefined
因为没有索引吗,如果有重复的, 第一个就会覆盖后面的,例如 proplists:get_value(a, [{a, 1}, [b,b,b], {a, 3}]). 1 但是有个好处是用proplists:append_value 把列表 ListIn 所有相同的键 Key 的值追加起来, Property 主要用于传递继承的属性,例如创建Frame 窗口后,要创建一个子控件,一般会把 [{parent, Frame}]作为Config 传递给创建子控件进程 在创建子控件进程中用proplists:get_valule(parent, Config)来获取Frame ?但是这个proplists怎么扩充的proplists:append我看得迷糊了! 可以通过get_value 或者值,也可以通过lookup获取 {K,V} proplist 好像不能对这个完全遍历 三:dict 一个键值(Key-Value)字典的实现 dict 的Value是一个列表,这样添加值是比较方便的, dict 有一个好处是可以过滤字典,还可以根据函数合并两个字典, 更新字典里面的值 还可以对字典里面的数值值进行相加操作 DESCRIPTION Dict implements a Key - Value dictionary. The representation of a dictionary is not defined. This module provides exactly the same interface as the module orddict. One difference is that while this module considers two keys as different if they do not match (=:=), orddict considers two keys as different if and only if they do not compare equal (==). 四: ets 可以返回表中第一个值, 可以通过fun2ms 转化为匹配项目, 表可以有set ,orderset 以及 bag 类型,比较好 还可以像数据库一样查找 五:maps 只是觉得maps 比较好用, 六:gb_trees 可以获取最大,最小,可以遍历,可以balance,好处是说不上来的,需要看大牛的博客, 坚强2002的博客有论述的!