Compiled global references now deref through the Jolt var cell instead of an early-bound Janet symbol, so redefining a def/defn is visible to already-compiled callers (Janet early-binds plain symbols). A global ref analyzes to :op :var (resolving/creating the cell); a def sets that same cell's root. Because Janet copies table constants but references functions, we embed memoized getter/setter closures over the cell rather than the cell itself. This also subsumes the old named-fn recursion rewrite and the separate ns-intern. ns-intern now stores the namespace *name* (string) in a var, not the ns table, so var cells aren't cyclic (required for embedding). fib(30) compiled ~0.5s (the late-binding cost vs phase 2's direct-linked 0.08s; direct-linking for hot calls is a later optimization). Suite green; cross-form, recursion, and context isolation preserved; redefinition now works. |
||
|---|---|---|
| .. | ||
| integration | ||
| spec | ||
| support | ||
| unit | ||