Renames each proc to map, each is left deprecated.
This commit is contained in:
parent
d0bd5d5cc3
commit
91700f29e7
7 changed files with 48 additions and 12 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue