diff --git a/Nim-for-Python-Programmers.md b/Nim-for-Python-Programmers.md index ca1163b..db5f472 100644 --- a/Nim-for-Python-Programmers.md +++ b/Nim-for-Python-Programmers.md @@ -222,3 +222,10 @@ for line in lines("yourfile.txt"): echo line ``` +### map and lambda +``` Nim +import sequtils # for map +let temperatures = map(locations, getTemperature) +let temperatures = map(locations, proc (loc: Location): float = getTemperature(loc, scale=C)) +``` +See [manual](https://nim-lang.org/docs/manual.html#procedures-anonymous-procs)