Corrected sortedByIt example
`people` needs `var`
This commit is contained in:
parent
c30d7c3208
commit
78b7625417
1 changed files with 1 additions and 1 deletions
|
|
@ -211,7 +211,7 @@ template sortedByIt*(seq1, op: expr): expr =
|
|||
## p3: Person = (name: "p3", age: 30)
|
||||
## p4: Person = (name: "p4", age: 30)
|
||||
##
|
||||
## people = @[p1,p2,p4,p3]
|
||||
## var people = @[p1,p2,p4,p3]
|
||||
##
|
||||
## echo people.sortedByIt(it.name)
|
||||
##
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue