t-nissieの日記: 【電脳】Erlangで遊んでみた 2日目 その1 proplists:get_value
日記 by
t-nissie
[{erlang, "a functional language"}, {ruby, "an OO language"},
{fortran, "a language for science"}]のようなキーワード値タプル
のリストを考える.リストとキーワードを受け取り,そのキーワード
に対応する値を返す関数を書け.
proplists:get_valueを自分で実装しろってことなんだろうなぁ.
わからん.
Erlang R15B02 (erts-5.9.2) [source] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.9.2 (abort with ^G)
1> List = [{erlang, "a functional language"}, {ruby, "an OO language"}, {fortran, "a language for science"}].
[{erlang,"a functional language"},
{ruby,"an OO language"},
{fortran,"a language for science"}]
2> proplists:get_value(fortran,List).
"a language for science"
3> proplists:get_value(c,List).
undefined
4> proplists:get_value(c,List,"not in List").
"not in List"
5>
【電脳】Erlangで遊んでみた 2日目 その1 proplists:get_value More ログイン