openarray/varargs split; breaks bootstrapping
This commit is contained in:
parent
1215193010
commit
0171566c98
29 changed files with 228 additions and 175 deletions
|
|
@ -161,17 +161,6 @@ proc assign*(dest: var TIntSet, src: TIntSet) =
|
|||
|
||||
it = it.next
|
||||
|
||||
template dollarImpl(): stmt =
|
||||
result = "{"
|
||||
for key in items(s):
|
||||
if result.len > 1: result.add(", ")
|
||||
result.add($key)
|
||||
result.add("}")
|
||||
|
||||
proc `$`*(s: TIntSet): string =
|
||||
## The `$` operator for int sets.
|
||||
dollarImpl()
|
||||
|
||||
iterator items*(s: TIntSet): int {.inline.} =
|
||||
## iterates over any included element of `s`.
|
||||
var r = s.head
|
||||
|
|
@ -190,6 +179,17 @@ iterator items*(s: TIntSet): int {.inline.} =
|
|||
inc(i)
|
||||
r = r.next
|
||||
|
||||
template dollarImpl(): stmt =
|
||||
result = "{"
|
||||
for key in items(s):
|
||||
if result.len > 1: result.add(", ")
|
||||
result.add($key)
|
||||
result.add("}")
|
||||
|
||||
proc `$`*(s: TIntSet): string =
|
||||
## The `$` operator for int sets.
|
||||
dollarImpl()
|
||||
|
||||
when isMainModule:
|
||||
var x = initIntSet()
|
||||
x.incl(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue