DlistIterator.endpoint: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/containers/dlist_iterator.bend as DlistIterator Lines 24-30 of bend-collections@1.0.0.0/src/containers/dlist_iterator.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/containers/dlist_iterator.bend&start_line=24&end_line=30 import Base import bend-collections@1.0.0.0/src/containers/doubly_linked_list.bend as D import bend-collections@1.0.0.0/src/containers/internal/dlist_storage.bend as R # Cursor links are arena indices plus one; zero is the gap past the end. # Only this owning iterator can mutate the list until finish. Public handles # retain their owner and generation; a cursor is never exposed as a handle. def endpoint(~T: Data, s: D.DList, +front: Bool) -> D.DList & U32: D.DL{tag, depth, cap, raw, gens} = s R.DL{owner, fresh, free, count, +head, +tail, rd, rc, vals, prevs, nexts} = raw (D.DL{tag, depth, cap, R.DL{owner, fresh, free, count, head, tail, rd, rc, vals, prevs, nexts}, gens}, choose(U32, front, head, tail)) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/dlist_iterator.bend&name=choose https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/doubly_linked_list.bend&name=DList https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/internal/dlist_storage.bend&name=DList