Added extendLeft

This commit is contained in:
Nocturn9x 2022-03-15 17:40:34 +01:00
parent 9ee6bdfb96
commit dbcc992006
1 changed files with 14 additions and 0 deletions

View File

@ -304,6 +304,20 @@ proc extend*[T](self: LinkedDeque[T], other: seq[T]) =
self.add(item)
proc extendLeft*[T](self: LinkedDeque[T], other: LinkedDeque[T]) =
## Same as self.extend(), but extends from
## the head instead of the tail
for item in other:
self.addLeft(item)
proc extendLeft*[T](self: LinkedDeque[T], other: seq[T]) =
## Same as self.extend(), but extends from
## the head instead of the tail
for item in other:
self.addLeft(item)
proc `$`*[T](self: LinkedDeque[T]): string =
## Returns a string representation
## of the deque