Created
May 16, 2010 02:57
-
-
Save darkua/402600 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proplists_get_value(Key,[H|_] = List) when erlang:is_tuple(H) -> | |
case lists:keyfind(Key,1,List) of | |
{K,V} when K =:= Key -> | |
V; | |
_-> | |
undefined | |
end; | |
proplists_get_value(_,[])-> | |
undefined; | |
proplists_get_value(Key,[H|Tail]) when erlang:is_atom(H) -> | |
case Key =:= H of | |
true-> | |
true; | |
_-> | |
proplists_get_value(Key,Tail) | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment