Skip to content

Declare the two forward-referenced vars - #3

Merged
yogthos merged 1 commit into
mainfrom
fix/declare-forward-refs
Jul 29, 2026
Merged

Declare the two forward-referenced vars#3
yogthos merged 1 commit into
mainfrom
fix/declare-forward-refs

Conversation

@yogthos

@yogthos yogthos commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

zoned.clj calls odt from the ZonedDateTime method map for toOffsetDateTime,
and fmt.clj calls parse-with-pattern from the formatter's .parse. Both vars
are defined further down in their own file.

JVM Clojure resolves a symbol when it analyzes the form, so neither file would
compile there. jolt used to accept them because its analyzer late-bound a symbol
inside a nested scope to a var in the compiling namespace and resolved it at call
time; it now reports the unresolved symbol at compile time like Clojure does, so
requiring jolt.time.zoned fails with "Unable to resolve symbol: odt in this
context". A declare in each file is what made the pattern legal in the first
place.

The suite passes: 97 tests, 1020 assertions, no failures.

Both files reference a var defined further down in the same file: zoned.clj
calls odt from the ZonedDateTime method map for toOffsetDateTime, and fmt.clj
calls parse-with-pattern from the formatter's .parse. JVM Clojure resolves a
symbol when it analyzes the form, so neither file would compile there, and jolt
used to accept them only because its analyzer late-bound a symbol inside a
nested scope to a var in the compiling namespace, resolved at call time. jolt
now reports the unresolved symbol at compile time like Clojure does, so both
files need the declare that made them legal in the first place.
@yogthos
yogthos merged commit 70dfb79 into main Jul 29, 2026
2 checks passed
yogthos pushed a commit to jolt-lang/examples that referenced this pull request Jul 29, 2026
jolt-lang/time#3 landed as a squash, so the sha this branch pinned is not on
main; point both deps at the commits the new tags name instead — time v0.0.3
(70dfb79) and db v0.0.2 (f368b12).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant