def dispose

bendvy-ecs-core@0.1.0.4 · system.bend:124

import bendvy-ecs-core@0.1.0.4/system.bend as System
import Base
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/registration.bend as Reg

124# Remove a registration only when its namespace/ID/name/access still match.
125# Success consumes Registry; refusal returns it with World. Does not dispose
126# unrelated retained Local/capture owners or invent implicit finalizers.
127def dispose(~S: Data,~C: Type,~R: Type,~E: Data,~Args: Type,~Error: Data,~Output: Type,~runner: W.World<S,C,R,E> -> Args -> Outcome<W.World<S,C,R,E>,Error,Output>,registry: Registry<S,C,R,E,Args,Error,Output,runner>,world: W.World<S,C,R,E>) -> Disposal<S,C,R,E,Args,Error,Output,runner>:
128  match registry:
129    case Registry{+namespace,+id,+name,+access,cursor}: dispose_returned(~S,~C,~R,~E,~Args,~Error,~Output,~runner,Registry{namespace,id,name,access,cursor},Reg.remove(~S,~C,~R,~E,world,namespace,id,name,access))

Uses (6)

Used by (5)