Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Perl

Idiom #330 Map to list

Create the list a containing all the values of the map m.

Ignore the keys of m. The order of a doesn't matter. a may contain duplicate values.

@a = values %m;

Perl has operators keys/values to extract keys/values into a list. The resulting list is not ordered.
using System.Linq;
var a = m.Values.ToList();

New implementation...
< >
programming-idioms.org