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

Ola Andersson A <>
Thu Mar 3 10:30:56 CET 2016


I actually have an implementation right now called key_collect ;-)
/OLA.

> -----Original Message-----
> From: Hugo Mills [mailto:]
> Sent: den 3 mars 2016 10:29
> To: Ola Andersson A
> Cc: 
> Subject: Re: [erlang-questions] On the wishlist was (RE: Proposal: add
> lists:intersperse/2 and lists:intercalate/2)
> 
> 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
>  carfax.org.uk | should execute their trainer!
> http://carfax.org.uk/  |
> PGP: E2AB1DE4          |                      Ming the Merciless, Flash Gordon



More information about the erlang-questions mailing list