The simulation was in a package of its own for one reason: importing raylib linked libraylib on every target, so the headless run could not name the package the interactive one needs. That reason is gone, and the split was never anything else — the physics is the same code either way. So sim.flan is back inside sand.flan, and test/programs/sand-headless.flan imports sand.flan itself: window, raylib bindings, dev agent and all. It builds for wasm32 anyway. Nothing it calls reaches raylib, so no shim is compiled, no -lraylib is passed, and the front-end's functions are never emitted; sand.flan's main is not exported, so the only main is the headless one. The hash is unchanged on both targets at both optimisation levels, which is the point — a refactor that moved the number would have moved the simulation. The new cases cover what made it possible rather than only the result: a package nothing calls into, native and wasm32; raylib reached both directly and through sand.flan and read once; and the three refusals — sand/main, one directory under two aliases, and two mains. test_session's package-qualification case moves to vendor/agent, which is now the package in the tree with a defn in it.
16 lines
491 B
Plaintext
16 lines
491 B
Plaintext
;;;; One package reached along two routes.
|
|
;;;;
|
|
;;;; raylib is imported here and again by sand.flan, which this also imports.
|
|
;;;; Loading it twice would declare every binding twice and be refused as a
|
|
;;;; collision, so a directory is read once and keyed by its real path. Nothing
|
|
;;;; calls into raylib, so nothing links it either.
|
|
|
|
(import sand "../../sand.flan")
|
|
(import rl "vendor:raylib")
|
|
|
|
(defn main [] i32
|
|
(sand/paint-at 4 (/ sand/cols 2))
|
|
(sand/step)
|
|
(print-line "ok")
|
|
0)
|