[erlang-questions] list comprehensions speed

Oleg lego12239@REDACTED
Tue Feb 25 17:42:32 CET 2014


On Tue, Feb 25, 2014 at 09:28:58AM -0500, Sean Cribbs wrote:
> I would do neither of those, there's a BIF just for this purpose:
> 
> lists:keyfind("name3", 1, A)
> 
> One could also use the slower, but perhaps easier to understand proplists
> (lists:keyfind/3 is more general):
> 
> proplists:get_value("name3", A)
> 
> If you are not reading the keys for those pairs from the outside world (a
> file, the network, etc), I'd use atoms instead of strings (just remove the
> quotes).

  Keys and values come from user input.



More information about the erlang-questions mailing list