-module(lookup). -export([by_key/2]). by_key(_, []) -> "unknown"; by_key(Key, [{Key, Val} | _]) -> Val; by_key(Key, [_ | Tail]) -> by_key(Key, Tail). % lookup:by_key(birthday, [{ice, "cream"}, {birthday, "cake"}]). % equivalent to proplists:get_value/2_