ecs/xsystem
cross-world system value + `defxsystem` surface.
Since: X2
XSystem
(defstruct XSystem [])
a runnable two-world bundle. Each slot (w0, w1) carries
Since: X2
make-xsystem
(make-xsystem)
bundle a top-level two-world run-fn with its
Since: X2
xsystem-w0-reads
(xsystem-w0-reads [s : XSystem] :)
Field accessors.
Since: X2
xsystem-w0-writes
(xsystem-w0-writes [s : XSystem] :)
xsystem-w1-reads
(xsystem-w1-reads [s : XSystem] :)
xsystem-w1-writes
(xsystem-w1-writes [s : XSystem] :)
xsystem-run-fn
(xsystem-run-fn [s : XSystem] :)
xsm-alloc
(xsm-alloc [n : int] :)
===========================================================================
Since: N-W-V0
xsm-set!
(xsm-set! [p : int i : int v : int] :)
store `v` at index `i` of the int64 array at `p`.
Since: N-W-V0
xsm-get
(xsm-get [p : int i : int] :)
load index `i` of the int64 array at `p`.
Since: N-W-V0
xsm-free
(xsm-free [p : int] :)
release an int64 array previously `xsm-alloc`'d.
Since: N-W-V0
XSystemN
(defstruct XSystemN [])
a runnable N-world bundle. `n` is the world count;
Since: N-W-V0
make-xsystem-n
(make-xsystem-n)
bundle an N-world run-fn with its mask arrays.
Since: N-W-V0
xsystemn-n
(xsystemn-n [s : XSystemN] :)
Field accessors.
Since: N-W-V0
xsystemn-reads
(xsystemn-reads [s : XSystemN] :)
xsystemn-writes
(xsystemn-writes [s : XSystemN] :)
xsystemn-run-fn
(xsystemn-run-fn [s : XSystemN] :)
xsystem--with-write-caps
(xsystem--with-write-caps [body wbind wtype comps])
wrap `body` in a let-chain binding
xsystem--with-read-caps
(xsystem--with-read-caps [body wbind wtype comps])
wrap `body` in a let-chain binding
xsystem--consume-write-caps
(xsystem--consume-write-caps [wbind comps])
emit `(use-cap! <wbind>-<Comp>-write-cap)`
defxsystem
(defxsystem [name worlds & clauses])
declare a cross-world System and its implementation.
Since: X2 (CLAUSE-V0: any clause order, empties omittable;
Internal definitions
xsystem--mask-- build the bit-or'd `(cid-bit <Comp>-cid)` mask forxsystem--n-loads-- ---------------------------------------------------------------------------xsystem--n-consumes-- emit one `(xsystem--consume-write-caps wbindxsystem--n-mask-fills-- emit the per-world `(xsm-set! __rds i MASK)`xsystem--n-checks-- the "every declared world appears in >= 1