$ for length?

bearophile bearophileHUGS at lycos.com
Thu Feb 20 06:23:48 PST 2014


Mengu:

> well, at least it's not len(ta).

A free function len() is quite useful if you want to use it in 
higher order functions:

map(len, ["red", "yo"])

In D:

["red", "yo"].map!(s => s.length)
["red", "yo"].map!walkLength

Bye,
bearophile


More information about the Digitalmars-d mailing list