5
在Erlang的外殼:orddict:fetch/2爲什麼瘋了?
> orddict:fetch(b, [{d, 2}, {a, 1}, {b,5}, {c,9}]).
** exception error: no function clause matching
orddict:fetch(b,[{d,2},{a,1},{b,5},{c,9}])
但
> orddict:fetch(b, [{a, 1}, {b,5}, {c,9}]).
5
缺少什麼我在這裏?
參考文獻:orddict:fetch/2
The orddict docs描述一個作爲orddict orddict() = [{Key :: term(), Value :: term()}]
。
@downvoter:小心點評? – nmichaels