From a594c9deb4fc8f4e45a76cb45e61e1606c849655 Mon Sep 17 00:00:00 2001 From: Yogthos Date: Tue, 23 Jun 2026 23:42:11 -0400 Subject: [PATCH] refactor: rename host-static-{statics,objects}.ss for clarity (jolt-wn0u) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The trio split on a fine axis (registry core / statics / object classes) but the names didn't say so — 'static-statics'/'static-objects' and headers that read 'Continues X'. Rename: host-static-statics.ss -> host-static-methods.ss (Class/member statics + fields) host-static-objects.ss -> host-static-classes.ss (instantiable object classes) host-static.ss stays the registry core. Headers rewritten to state each file's role and what it covers instead of chaining. rt.ss loads + the one comment reference + MODULES.md updated. No code moved; runtime .ss, make test green. --- docs/MODULES.md | 3 ++- .../{host-static-objects.ss => host-static-classes.ss} | 9 +++++---- .../{host-static-statics.ss => host-static-methods.ss} | 8 +++++--- host/chez/host-static.ss | 5 ++++- host/chez/records-interop.ss | 2 +- host/chez/rt.ss | 4 ++-- 6 files changed, 19 insertions(+), 12 deletions(-) rename host/chez/{host-static-objects.ss => host-static-classes.ss} (98%) rename host/chez/{host-static-statics.ss => host-static-methods.ss} (97%) diff --git a/docs/MODULES.md b/docs/MODULES.md index e95fa00..2cf3b33 100644 --- a/docs/MODULES.md +++ b/docs/MODULES.md @@ -32,7 +32,8 @@ composed and where a given `.ss` fits. thread-local binding stack), `dynamic-vars.ss` (a few `*…*` constant defaults), `atoms.ss`, `multimethods.ss`. - **Host interop**: `host-class.ss` (class tokens + method dispatch), - `host-static*.ss` (static methods/fields + host object classes), `host-table.ss`, + `host-static.ss` (interop registry core) + `host-static-methods.ss` (`Class/member` + statics) + `host-static-classes.ss` (instantiable object classes), `host-table.ss`, `host-contract.ss` (the `jolt.host` seam the compiler resolves against), `dot-forms.ss`, `records-interop.ss`. - **Scalars / misc**: `regex.ss` (vendored irregex), `math.ss`, `inst-time.ss`, diff --git a/host/chez/host-static-objects.ss b/host/chez/host-static-classes.ss similarity index 98% rename from host/chez/host-static-objects.ss rename to host/chez/host-static-classes.ss index c0fffc4..b6de1a4 100644 --- a/host/chez/host-static-objects.ss +++ b/host/chez/host-static-classes.ss @@ -1,7 +1,8 @@ -;; host-static-objects.ss — host object classes (ArrayList, HashMap, the -;; String/Reader/Writer/Tokenizer shims, BigInteger/MapEntry ctors, URL codecs) -;; and the tagged-table method dispatch + pluggable instance? hook. Continues -;; host-static-statics.ss; loaded last of the three. +;; host-static-classes.ss — instantiable host object classes: ArrayList, HashMap, +;; the String/Reader/Writer/Tokenizer shims, BigInteger/MapEntry ctors, and URL +;; codecs. Holds the tagged-table method dispatch (the (.method ...) arm on a jhost) +;; and the pluggable instance? hook. Loaded after host-static-methods.ss; the +;; `Class/member` static methods live there, the registry core in host-static.ss. ;; ---- java.util.ArrayList ---------------------------------------------------- ;; A mutable list backed by a growable Scheme vector. State is #(backing count); diff --git a/host/chez/host-static-statics.ss b/host/chez/host-static-methods.ss similarity index 97% rename from host/chez/host-static-statics.ss rename to host/chez/host-static-methods.ss index 1b18803..f3afc03 100644 --- a/host/chez/host-static-statics.ss +++ b/host/chez/host-static-methods.ss @@ -1,6 +1,8 @@ -;; host-static-statics.ss — java.lang / java.util.* static methods and the -;; NumberFormat / Class registries. Continues host-static.ss (its registries + -;; jhost record + coercion helpers); loaded right after it. +;; host-static-methods.ss — the `Class/member` static surface: java.lang.Math, +;; System (properties/env), Thread, the Long/Integer/Double/Character/String static +;; methods, java.text.NumberFormat, and the Class registry. Registers into +;; host-static.ss's class-statics table (loaded just before this); instantiable host +;; object classes (ArrayList, StringBuilder, …) live in host-static-classes.ss. ;; ---- java.lang statics ------------------------------------------------------ ;; java.lang.Math: sqrt/pow/floor/ceil/trig/log/exp always return a DOUBLE on the diff --git a/host/chez/host-static.ss b/host/chez/host-static.ss index 5c65acd..2798be1 100644 --- a/host/chez/host-static.ss +++ b/host/chez/host-static.ss @@ -1,4 +1,7 @@ -;; host-static.ss — host class statics + constructors on Chez. +;; host-static.ss — the host-interop registry core: the class-statics / class-ctors +;; / tagged-methods tables, the jhost record, and the coercion helpers. The actual +;; entries are registered by host-static-methods.ss (Class/member statics) and +;; host-static-classes.ss (instantiable object classes), loaded after this. ;; ;; The analyzer lowers `Class/member` to a :host-static node and `(Class. ...)` / ;; `(new Class ...)` to a :host-new node (jolt-core/jolt/analyzer.clj); the Chez diff --git a/host/chez/records-interop.ss b/host/chez/records-interop.ss index 3ab5141..0ef0c0a 100644 --- a/host/chez/records-interop.ss +++ b/host/chez/records-interop.ss @@ -50,7 +50,7 @@ (else (let ((p (assoc c exception-parent))) (loop (and p (cdr p)))))))) ;; instance-check: (type-sym val) — type/protocol membership. Host shims loaded -;; later (io, inst-time, natives-array, natives-queue, host-static-objects) +;; later (io, inst-time, natives-array, natives-queue, host-static-classes) ;; register an arm with register-instance-check-arm! instead of set!-wrapping ;; instance-check; an arm returns #t/#f to decide or 'pass to defer to the next. ;; Newest arm is checked first (matches the old outermost-wins set! order). diff --git a/host/chez/rt.ss b/host/chez/rt.ss index cd544b6..ac184e0 100644 --- a/host/chez/rt.ss +++ b/host/chez/rt.ss @@ -327,8 +327,8 @@ ;; record-method-dispatch (records.ss) and reuses natives-str helpers (str-trim, ;; ascii-string-down, re-split, str-split-drop-trailing) + the regex-t accessors. (load "host/chez/host-static.ss") ; registries + jhost + coercion helpers -(load "host/chez/host-static-statics.ss") ; java.lang/util static methods -(load "host/chez/host-static-objects.ss") ; host object classes + instance? hook +(load "host/chez/host-static-methods.ss") ; Class/member static methods + fields +(load "host/chez/host-static-classes.ss") ; instantiable host object classes ;; generic dot-form dispatch: field access + map/vector member access ;; for the `.` / `.-field` desugar. Loads after host-static.ss so it wraps every