Added deques module, deprecating queues
This commit is contained in:
parent
01ae0d28d4
commit
2c146445bc
10 changed files with 297 additions and 25 deletions
|
|
@ -18,15 +18,15 @@ echo v[2]
|
|||
|
||||
# bug #569
|
||||
|
||||
import queues
|
||||
import deques
|
||||
|
||||
type
|
||||
TWidget = object
|
||||
names: Queue[string]
|
||||
names: Deque[string]
|
||||
|
||||
var w = TWidget(names: initQueue[string]())
|
||||
var w = TWidget(names: initDeque[string]())
|
||||
|
||||
add(w.names, "Whopie")
|
||||
addLast(w.names, "Whopie")
|
||||
|
||||
for n in w.names: echo(n)
|
||||
|
||||
|
|
|
|||
|
|
@ -98,13 +98,13 @@ block:
|
|||
x += 10
|
||||
echo sl
|
||||
|
||||
import queues
|
||||
import deques
|
||||
|
||||
block:
|
||||
var q = initQueue[int]()
|
||||
q.add(1)
|
||||
q.add(2)
|
||||
q.add(3)
|
||||
var q = initDeque[int]()
|
||||
q.addLast(1)
|
||||
q.addLast(2)
|
||||
q.addLast(3)
|
||||
for x in q.mitems:
|
||||
x += 10
|
||||
echo q
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import ospaths
|
|||
# import parseopt
|
||||
import parseutils
|
||||
# import pegs
|
||||
import queues
|
||||
import deques
|
||||
import sequtils
|
||||
import strutils
|
||||
import subexes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue