View Problem

Perform an operation on every item of a list

Perform an operation on every item of a list, e.g.
for the list ["ox", "cat", "deer", "whale"] calculate
the list of sizes of the strings, e.g. [2, 3, 4, 5]
ExpandDiskEdit
php
$sizes = array_map('strlen', array('ox', 'cat', 'deer', 'whale'));
DiskEdit
clojure
(map count ["ox" "cat" "deer" "whale"])
ExpandDiskEdit
fantom
["ox", "cat", "deer", "whale"].map { it.size }

Submit a new solution for php, clojure, or fantom
There are 14 other solutions in additional languages (cpp, csharp, erlang, fsharp ...)