Renames each proc to map, each is left deprecated.

This commit is contained in:
Grzegorz Adam Hankiewicz 2013-01-22 20:29:07 +01:00
commit 91700f29e7
7 changed files with 48 additions and 12 deletions

View file

@ -4,8 +4,8 @@ import json, tables
proc run(json_params: TTable) =
let json_elems = json_params["files"].elems
# These fail compilation.
var files = each(json_elems, proc (x: PJsonNode): string = x.str)
#var files = json_elems.each do (x: PJsonNode) -> string: x.str
var files = map(json_elems, proc (x: PJsonNode): string = x.str)
#var files = json_elems.map do (x: PJsonNode) -> string: x.str
echo "Hey!"
when isMainModule:

View file

@ -21,7 +21,7 @@ proc takeParseInt(x: proc (y: string): int {.noSideEffect.}): int =
result = x("123")
echo "Give a list of numbers (separated by spaces): "
var x = stdin.readline.split.each(parseInt).max
var x = stdin.readline.split.map(parseInt).max
echo x, " is the maximum!"
echo "another number: ", takeParseInt(parseInt)