fix: threading macros, REPL stability, and CI coverage

- fix(emitter): emitFnWrapper now uses runtimeName for builtin operators
- fix(emitter): map/reduce handlers support variadic runtime functions (+, -, etc.)
- fix(emitter): variadic runtime functions list extracted to variadicRuntimeFns constant
- fix(macros): restore correct thread-first behavior (->) and fix result shadowing
- fix(macros): and/or/as->/some->/some->> macro result variable fixes
- fix(repl): add macroexpand step before interpreter eval
- fix(runtime): cljReduceSeq handles nil init (uses first coll element)
- fix(eval): add macroexpand/macroexpand-1 special forms to interpreter
- fix(eval): add macros module import for macroexpand access
- fix(warnings): eliminate ResultShadowed and UnusedImport warnings
- chore(.gitignore): remove artifact entries (-o, =0.4.0), unignore lib/bring_http.nim
- chore(ci): run all examples + threading macro + macroexpand REPL smoke tests
This commit is contained in:
2026-05-12 20:02:58 +03:00
parent 014a192c5d
commit 4b208dbe55
8 changed files with 136 additions and 83 deletions
+8
View File
@@ -14,8 +14,12 @@ test:
- echo "=== math ===" && ./cljnim run examples/math.clj
- echo "=== macros ===" && ./cljnim run examples/macros.clj
- echo "=== ai_tools ===" && ./cljnim run examples/ai_tools.clj || true
- echo "=== ai_features ===" && ./cljnim run examples/ai_features.clj || true
- echo "=== ffi ===" && ./cljnim run examples/ffi.clj
- echo "=== interop ===" && ./cljnim run examples/interop.clj
- echo "=== fizzbuzz ===" && ./cljnim run examples/fizzbuzz.clj
- echo "=== jsonista ===" && ./cljnim run examples/jsonista.clj
- echo "=== wordfreq ===" && ./cljnim run examples/wordfreq.clj
# Smoke test REPL (interpreter path)
- printf '{"op":"eval","form":"(+ 1 2 3)"}\n{"op":"quit"}\n' | timeout 5 ./cljnim repl --json | head -3
# Smoke test REPL (tool-call format)
@@ -27,6 +31,10 @@ test:
- printf '{"op":"eval","form":"(let [c (chan 3)] (>! c 42) (<! c))"}\n{"op":"quit"}\n' | timeout 5 ./cljnim repl --json | head -3
# Test agents in REPL
- printf '{"op":"eval","form":"(do (def a (agent 0)) (send a inc) (deref a))"}\n{"op":"quit"}\n' | timeout 5 ./cljnim repl --json | head -4
# Test threading macros in REPL
- printf '{"op":"eval","form":"(-> [1 2 3] (map inc))"}\n{"op":"quit"}\n' | timeout 5 ./cljnim repl --json | head -3
- printf '{"op":"eval","form":"(->> [1 2 3] (map inc) (reduce +))"}\n{"op":"quit"}\n' | timeout 5 ./cljnim repl --json | head -3
- printf '{"op":"eval","form":"(macroexpand (quote (-> [1 2 3] (map inc))))"}\n{"op":"quit"}\n' | timeout 5 ./cljnim repl --json | head -3
# Test compiled path
- ./cljnim -e '(+ 10 20)'
- ./cljnim -e '(quot 17 3)'