Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
This commit is contained in:
commit
5d4c048705
10 changed files with 115 additions and 31 deletions
|
|
@ -516,7 +516,7 @@ proc last*(node: PNimrodNode): PNimrodNode {.compileTime.} = node[node.high]
|
|||
|
||||
|
||||
const
|
||||
RoutineNodes* = {nnkProcDef, nnkMethodDef, nnkDo, nnkLambda}
|
||||
RoutineNodes* = {nnkProcDef, nnkMethodDef, nnkDo, nnkLambda, nnkIteratorDef}
|
||||
AtomicNodes* = {nnkNone..nnkNilLit}
|
||||
CallNodes* = {nnkCall, nnkInfix, nnkPrefix, nnkPostfix, nnkCommand,
|
||||
nnkCallStrLit, nnkHiddenCallConv}
|
||||
|
|
|
|||
|
|
@ -241,3 +241,7 @@ proc `<=`*[A](s, t: TSet[A]): bool =
|
|||
|
||||
proc `==`*[A](s, t: TSet[A]): bool =
|
||||
s.counter == t.counter and s <= t
|
||||
|
||||
proc map*[A, B](data: TSet[A], op: proc (x: A): B {.closure.}): TSet[B] =
|
||||
result = initSet[B]()
|
||||
for item in data: result.incl(op(item))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue