refactor: rename host-static-{statics,objects}.ss for clarity (jolt-wn0u)
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.
This commit is contained in:
parent
4461179804
commit
a594c9deb4
6 changed files with 19 additions and 12 deletions
|
|
@ -32,7 +32,8 @@ composed and where a given `.ss` fits.
|
||||||
thread-local binding stack), `dynamic-vars.ss` (a few `*…*` constant defaults),
|
thread-local binding stack), `dynamic-vars.ss` (a few `*…*` constant defaults),
|
||||||
`atoms.ss`, `multimethods.ss`.
|
`atoms.ss`, `multimethods.ss`.
|
||||||
- **Host interop**: `host-class.ss` (class tokens + method dispatch),
|
- **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),
|
`host-contract.ss` (the `jolt.host` seam the compiler resolves against),
|
||||||
`dot-forms.ss`, `records-interop.ss`.
|
`dot-forms.ss`, `records-interop.ss`.
|
||||||
- **Scalars / misc**: `regex.ss` (vendored irregex), `math.ss`, `inst-time.ss`,
|
- **Scalars / misc**: `regex.ss` (vendored irregex), `math.ss`, `inst-time.ss`,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
;; host-static-objects.ss — host object classes (ArrayList, HashMap, the
|
;; host-static-classes.ss — instantiable host object classes: ArrayList, HashMap,
|
||||||
;; String/Reader/Writer/Tokenizer shims, BigInteger/MapEntry ctors, URL codecs)
|
;; the String/Reader/Writer/Tokenizer shims, BigInteger/MapEntry ctors, and URL
|
||||||
;; and the tagged-table method dispatch + pluggable instance? hook. Continues
|
;; codecs. Holds the tagged-table method dispatch (the (.method ...) arm on a jhost)
|
||||||
;; host-static-statics.ss; loaded last of the three.
|
;; 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 ----------------------------------------------------
|
;; ---- java.util.ArrayList ----------------------------------------------------
|
||||||
;; A mutable list backed by a growable Scheme vector. State is #(backing count);
|
;; A mutable list backed by a growable Scheme vector. State is #(backing count);
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
;; host-static-statics.ss — java.lang / java.util.* static methods and the
|
;; host-static-methods.ss — the `Class/member` static surface: java.lang.Math,
|
||||||
;; NumberFormat / Class registries. Continues host-static.ss (its registries +
|
;; System (properties/env), Thread, the Long/Integer/Double/Character/String static
|
||||||
;; jhost record + coercion helpers); loaded right after it.
|
;; 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 statics ------------------------------------------------------
|
||||||
;; java.lang.Math: sqrt/pow/floor/ceil/trig/log/exp always return a DOUBLE on the
|
;; java.lang.Math: sqrt/pow/floor/ceil/trig/log/exp always return a DOUBLE on the
|
||||||
|
|
@ -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. ...)` /
|
;; 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
|
;; `(new Class ...)` to a :host-new node (jolt-core/jolt/analyzer.clj); the Chez
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
(else (let ((p (assoc c exception-parent))) (loop (and p (cdr p))))))))
|
(else (let ((p (assoc c exception-parent))) (loop (and p (cdr p))))))))
|
||||||
|
|
||||||
;; instance-check: (type-sym val) — type/protocol membership. Host shims loaded
|
;; 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
|
;; 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.
|
;; 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).
|
;; Newest arm is checked first (matches the old outermost-wins set! order).
|
||||||
|
|
|
||||||
|
|
@ -327,8 +327,8 @@
|
||||||
;; record-method-dispatch (records.ss) and reuses natives-str helpers (str-trim,
|
;; 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.
|
;; 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.ss") ; registries + jhost + coercion helpers
|
||||||
(load "host/chez/host-static-statics.ss") ; java.lang/util static methods
|
(load "host/chez/host-static-methods.ss") ; Class/member static methods + fields
|
||||||
(load "host/chez/host-static-objects.ss") ; host object classes + instance? hook
|
(load "host/chez/host-static-classes.ss") ; instantiable host object classes
|
||||||
|
|
||||||
;; generic dot-form dispatch: field access + map/vector member access
|
;; generic dot-form dispatch: field access + map/vector member access
|
||||||
;; for the `.` / `.-field` desugar. Loads after host-static.ss so it wraps every
|
;; for the `.` / `.-field` desugar. Loads after host-static.ss so it wraps every
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue