MachineStreamQueue.past_normalized_generic: def of bendvy-ecs-core@0.1.0.3 Import: import bendvy-ecs-core@0.1.0.3/machine_stream_queue.bend as MachineStreamQueue Lines 40-45 of bendvy-ecs-core@0.1.0.3/machine_stream_queue.bend: https://jend.leeeet.dev/read.txt?path=bendvy-ecs-core@0.1.0.3/machine_stream_queue.bend&start_line=40&end_line=45 import Base # Match the canonical two-pass policy even for non-monotonic supplied ticks: # first remove the expired prefix, then evict whole batches for capacity only. def past_normalized_generic(-E:Data,queue:Queue,+boundary:Nat,ih:Queue -> Queue) -> Queue: match queue: case Queue{Nil{},back,size,dropped,batches}:Queue{[],back,size,dropped,batches} case Queue{Batch{+tick,+count,+items} <> +rest,+back,+size,+dropped,+batches}:trim_step_generic(E,Nat.is_le(tick,boundary),tick,count,items,rest,back,size,dropped,batches,ih) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/machine_stream_queue.bend&name=Batch https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/machine_stream_queue.bend&name=Queue https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/machine_stream_queue.bend&name=trim_step_generic