feat: 80/80 unit tests, real-world examples (FizzBuzz, WordFreq)

- Emitter: def registry (definedGlobals) for symbol emit distinction
- Emitter: cond emits return statements
- Emitter: reduce wraps named functions in closure adapter
- Emitter: clojure.string/* function mappings (split, lower-case, etc.)
- Emitter: statement detection for echo cljRepr wrapping
- Runtime: cljGet supports default value (3 args)
- Runtime: cljStrSplit supports regex patterns via re module
- Examples: fizzbuzz.clj and wordfreq.clj both compile and run correctly
- Tests: emit symbol / emit mangled symbol now pass (80/80)
- Compliance: 233/233 (100%) maintained
This commit is contained in:
2026-05-11 10:08:46 +03:00
parent 4afef5a264
commit 456636700c
6 changed files with 169 additions and 43 deletions
+13
View File
@@ -0,0 +1,13 @@
; FizzBuzz — classic programming challenge
; Tests: cond, mod, map, range, str, println
(defn fizzbuzz [n]
(cond
(= (mod n 15) 0) "FizzBuzz"
(= (mod n 3) 0) "Fizz"
(= (mod n 5) 0) "Buzz"
:else (str n)))
(println "=== FizzBuzz 1-30 ===")
(doseq [i (range 1 31)]
(println (fizzbuzz i)))