Question

What is the equivalent of the following python code

map(func, list)

in vala?

Was it helpful?

Solution

There's no such shortcut. You have to do a foreach:

var res = new YourList ();
foreach (var elem in list) res.add (func (elem));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top