import only the modules each unit uses

An import brings the types and constants its interface needs now
(sex#58): a module pub-imports what its pub forms hold, and sexc
refuses one that does not. Every unit had imported its whole
dependency chain in order to make up for it.

worldgen also pub-imports json, whose cJSON.h its pub fns take
pointers into; a type only C knows is not something sexc can check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 18:22:41 +03:00
parent b8030b86bc
commit 1b6ac779a8
12 changed files with 2 additions and 78 deletions

View File

@@ -10,17 +10,10 @@
;;; if it were rock, as the game's prospecting assumes too.
(include stdio.h stdlib.h string.h math.h)
;; TODO sex#58: import only the modules used here once an import brings
;; the types its interface needs; until then, every dependency, in
;; dependency order.
(pub import maps)
(import lcg)
(import noise)
(import shape)
(import json)
(import worldgen)
(import fastnoise)
(import rivers)
(pub import terra)
(pub define MAX-ROCKS 32)