No matching definitions.

ecs/refined-world

src/ecs/refined-world.tur

an aliveness-refined world facade (RE1 / gap C2).

Since: RE1 2026-07-26; :sealed 2026-07-29

defopaque

RGWorld

(RGWorld)
defn

rgworld-new

(rgworld-new :)
defn

rgworld-spawn!

(rgworld-spawn! [^unique ^mut w : RGWorld x0 : int] :)
defn

rgworld-despawn!

(rgworld-despawn! [^unique ^mut w : RGWorld e : Entity] :)
defn

rgworld-alive?

(rgworld-alive? [^borrow w : RGWorld e : Entity])
defn

rgworld-get-x!

(rgworld-get-x! [^borrow w : RGWorld e : #refine{ x : Entity | (rgworld-alive? w x) }] :)
defn

rgworld-set-x!

(rgworld-set-x! [^unique ^mut w : RGWorld e : Entity v : int] :)
defn

rgworld-ent-at

(rgworld-ent-at [i : int] :)

the first-generation entity candidate for slot i.

islot index

The Entity (slot i, generation 0).

(rgworld-alive? w (rgworld-ent-at 0))

Since: RE1 2026-07-26

defmacro

for-each-alive!

(for-each-alive! [w n binder & body])

run body for each still-alive entity in slots 0..n-1,

wthe owned `^mut` world local (borrowed per iteration)
nslot count to scan (slots 0..n-1)
bindername bound to the proven-alive Entity for the body
bodyforms run per alive entity (result discarded; loop yields 0)
(for-each-alive! w 3 e
    (println (rgworld-get-x! w e)))   ;; proves; skips despawned slots

Since: RE1 2026-07-26

Internal definitions
rgw-alloc
rgw-gen
rgw-bump
rgw-xget
rgw-xset
rgw-next
rgw-ctrl