fix: expand variadic list + add runtime stubs — 174/233 (74%)

Runtime: cljCompare, cljSubvec, cljRand, cljRandInt, cljRandNth,
cljRandomSample with native Nim implementations
Emitter: expanded variadic function list for correct seq[CljVal] calling

Results: 174/233 passed (74%)
  clojure.string: 8/8 (100%)
  clojure.core: 166/225 (74%)
This commit is contained in:
2026-05-09 18:21:14 +03:00
parent cb69df4ee2
commit f79a2591d4
2 changed files with 102 additions and 2 deletions
+12 -1
View File
@@ -272,6 +272,12 @@ proc runtimeName(op: string): string =
of "binding": "cljBinding"
of "aset": "cljAset"
of "vector": "cljVectorFn"
of "compare": "cljCompare"
of "subvec": "cljSubvec"
of "rand": "cljRand"
of "rand-int": "cljRandInt"
of "rand-nth": "cljRandNth"
of "random-sample": "cljRandomSample"
# ---- Type conversion ----
of "float": "cljToFloat"
of "int": "cljToInt"
@@ -1219,7 +1225,12 @@ proc emitSpecialForm(items: seq[CljVal], indent: int): string =
"zipmap", "hash-map", "hash-set", "sorted-map", "sorted-set",
"array-map", "inf", "nan",
"float", "int", "double", "long", "short", "byte",
"boolean", "num", "number"]
"boolean", "num", "number",
"drop-last", "shuffle", "repeatedly", "fnil", "intern",
"println-str", "prn-str", "binding", "aset",
"volatile!", "deliver", "doall", "dorun",
"to-array", "vector", "rand", "rand-int",
"rand-nth", "random-sample"]
var call: string
if variadic:
call = rn & "(@[" & argParts.join(", ") & "])"