79cd9c08d8
- Bulk replace Clojure/Nim → Bara Lang in src/, lib/, examples/, benchmarks/, experiments/, books/, LICENSE, cljnim.nimble, PLAN.md, AI_AGENT.md - Rename book chapters: 05-clojure-nim.md → 05-bara-lang.md (en + bg) - Update all chapter index links and anchors - Replace project-specific 'Clojure' references with 'Bara Lang' in experiments/, src/ai_assist.nim, src/tui_screens.nim, src/emitter.nim, src/reader.nim, src/types.nim, lib/cljnim_runtime*.nim - Keep legitimate JVM Clojure/ClojureScript/Clojure CLR references intact
20 lines
526 B
Nim
20 lines
526 B
Nim
# JS-friendly wrappers around Bara Lang-generated code
|
|
# These expose plain JS types (number, string) instead of CljVal
|
|
|
|
import cljnim_runtime_js
|
|
|
|
# Import the generated Bara Lang functions
|
|
include build/math
|
|
|
|
proc jsSquare*(x: int): int {.exportc.} =
|
|
let r = square(cljInt(x.int64))
|
|
return r.intVal.int
|
|
|
|
proc jsFactorial*(n: int): int {.exportc.} =
|
|
let r = factorial(cljInt(n.int64))
|
|
return r.intVal.int
|
|
|
|
proc jsGreet*(name: cstring): cstring {.exportc.} =
|
|
let r = greet(cljString($name))
|
|
return r.strVal.cstring
|