Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:domeengine/dome into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
avivbeeri committed Sep 21, 2023
2 parents 6057709 + 977fc3f commit 3312cc4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/modules/collections.wren
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ class Stack is Sequence {
clear() { _list.clear() }

add(v) { push(v) }
addAll(other) {
for (item in other) {
push(item)
}
}

remove() { pop() }
get() { peek() }

Expand Down Expand Up @@ -114,6 +120,11 @@ class Set is Sequence {
var hash = hashValue(value)
_map[hash] = value
}
addAll(other) {
for (item in other) {
add(item)
}
}
clear() { _map.clear() }

hashValue(v) {
Expand Down Expand Up @@ -142,6 +153,7 @@ class Queue is Sequence {
_list = []
}
add(item) { _list.add(item) }
addAll(other) { _list.addAll(other) }
remove() {
if (_list.isEmpty) {
return null
Expand Down

0 comments on commit 3312cc4

Please sign in to comment.