collections: RingList, ConsStack, BankersQueue, Heap (C7) #139
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Tracking issue for C7 of COLLECTIONS.md: the implementations that make the
List,StackandQueuetraits worth having, and the priority structure of section 3.4. C7 is larger than one PR (four types, each with conformance tests and a benchmark), so it is split one issue per type:RingList(ready)ConsStack(ready)BankersQueue(ready; shares the node type with #198)Heap(waiting on an owner decision: member words)Acceptance criteria
Heapinstead of the superseded nameOrdered.docs/ROADMAP.mdcollections row stays accurate (C8 / #140 is separate).Design record
COLLECTIONS.md: section 3.3 (cost table), 3.4 (no
Deque, noPriorityQueuetrait), 3.10 (points 4 and 5), section 6 questions 4 to 6 (names answered 2026-09-23:Heap,RingList, tour keepsStack/Queue).Seed impact
None for any of the four: new public types in
std/collectionsin plain TorbScript, no syntax change, no new native, no std name looked up by string.Dependencies
#199 after #198 if they share the node type. Otherwise independent.
[loop:torbscript] claim refine by session:loop-torbscript-20261008 until 2026-10-08T17:40:00Z
[loop:torbscript] refine: C7 is larger than one PR, so it is split into #197 (
RingList), #198 (ConsStack), #199 (BankersQueue) and #200 (Heap); this issue is now the tracking issue (body rewritten with goal, acceptance criteria, design record and seed impact: none). #197 to #199 areready(names settled by the owner on 2026-09-23, additive, no seed refresh), next: implement.[loop:torbscript] owner decision: which member words does
Heapuse?What: the
Heapsnippet in COLLECTIONS.md section 3.4 still readstype Ordered<Item> with Collection<Item>withadd/remove. Since thenCollectionwas deleted and every kind got its own words (section 6b:push/pop,enqueue/dequeue,append,insert). The nameHeapis settled, the words are not, andHeapis neither aStacknor aQueue.Options:
insert(value)/removeSmallest()/peekSmallest(): says the contract (the smallest key leaves first) at the call, no clash with theStack/Queueverbs.push(value)/pop()/peek(): the words everybody knows from a binary heap, but they read as a stack andStackhas a different order contract.add(value)/remove()as in the stale snippet:addwas taken away from the container kinds in 6b, so it would reintroduce the word the record removed.Recommendation: option 1. It keeps one vocabulary per kind, and the key order is visible in the name. #200 follows the answer; the other three types do not wait for it.
next: waiting (owner decision)
[loop:torbscript] owner decision recorded (torben via WhatsApp, 2026-10-08 16:35 Europe/Berlin): "Ja okay" (option 1).
Resolution:
Heapusesinsert(value)/removeSmallest()/peekSmallest(); COLLECTIONS.md 3.4 snippet updated in the same PR. #200 labelledready.[question-closed] q=q1 reason=answered-elsewhere
[loop:torbscript] claim implement by session:loop-torbscript-20261009 until 2026-10-09T12:50Z
#197 to #200 are closed and merged, but the C7 paragraph of COLLECTIONS.md still reads "Built so far: RingList" and is not marked Done. A docs-only PR closes that.
[loop:torbscript] implement: PR #256 open, CI green (
a47e171a), next: review (waiting on the merge gate argus)[loop:torbscript] close: correction to the comment above, PR #256 is already merged by argus (merge commit
b1d76a4f). All four C7 types landed and COLLECTIONS.md C7 reads Done; #212 stays open as the known literal gap. Issue closed.