[erlang-questions] On the wishlist was (RE: Proposal: add lists:intersperse/2 and lists:intercalate/2)

Hugo Mills hugo@REDACTED
Thu Mar 3 10:29:22 CET 2016


On Thu, Mar 03, 2016 at 09:25:24AM +0000, Ola Andersson A wrote:
> Hi List,
> While we're at it, there is a function I would like to see in proplists.
> I need a function that returns the same as this construct:
> 
> [{Key, proplists:get_all_values(Key, PropList)} || Key <- proplists:get_keys(PropList)].
> 
> But of course with a more efficient implementation.
> I have implemented this in a number of different ways in pure erlang lately but a function in proplists would be really nice to have.
> No idea what to call it though. Maybe:
> 
> proplists:get_all_key_values(proplist()).
> 
> Not really that great. Better suggestions are welcome.

   collect/1, maybe? You're collecting all the values for each key
into a single list.

   Hugo.

-- 
Hugo Mills             | Klytus! Are your men on the right pills? Maybe you
hugo@REDACTED carfax.org.uk | should execute their trainer!
http://carfax.org.uk/  |
PGP: E2AB1DE4          |                      Ming the Merciless, Flash Gordon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160303/4768537f/attachment.bin>


More information about the erlang-questions mailing list