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:
Symlink
+1
@@ -0,0 +1 @@
|
||||
/home/ziko/bara-eco/bring/lib/bring_http.nim
|
||||
+11
-3
@@ -1476,9 +1476,17 @@ proc cljFilterSeq*(f: proc(args: seq[CljVal]): CljVal, coll: seq[CljVal]): seq[C
|
||||
result.add(item)
|
||||
|
||||
proc cljReduceSeq*(f: proc(args: seq[CljVal]): CljVal, init: CljVal, coll: seq[CljVal]): CljVal =
|
||||
result = init
|
||||
for item in coll:
|
||||
result = f(@[result, item])
|
||||
if coll.len == 0:
|
||||
return init
|
||||
var i = 0
|
||||
if init.isNil or init.kind == ckNil:
|
||||
result = coll[0]
|
||||
i = 1
|
||||
else:
|
||||
result = init
|
||||
while i < coll.len:
|
||||
result = f(@[result, coll[i]])
|
||||
i += 1
|
||||
|
||||
proc cljMap*(f: proc(args: seq[CljVal]): CljVal, coll: CljVal): CljVal =
|
||||
if coll.isNil: return cljList(@[])
|
||||
|
||||
Reference in New Issue
Block a user