New 30-macros tier (registered after 20-coll) for user-facing macros expressed as defmacro + syntax-quote instead of hand-built Janet form-transformers. Validated end to end: overlay-defined macros expand in interpret, compile AND self-host modes (conformance 228/228 x3). Moved comment and if-not; removed their Janet core-X fns + core-macro-names entries. Note: Jolt defmacro is single-arity, so multi-arglist macros become one arglist with & rest / destructuring (if-not uses [test then & [else]]). Macros used by the compiler or earlier tiers (and/or/when/cond/case/cond->/->/declare/ doseq/when-let) stay in Janet until a load-order story exists for them. full suite green, clojure-test-suite 3930.
18 lines
919 B
Clojure
18 lines
919 B
Clojure
;; clojure.core — macro tier. Macros expressed in Clojure (defmacro + syntax-quote)
|
|
;; rather than as hand-built Janet form-transformers. Loaded after the fn tiers,
|
|
;; so a macro here may use any already-frozen core fn/macro.
|
|
;;
|
|
;; IMPORTANT — only macros NOT used by the self-hosted compiler (jolt-core/jolt/*)
|
|
;; or by the earlier overlay tiers belong here; those (and/or/when/when-not/
|
|
;; when-let/cond/case/doseq/declare/cond->/->) must stay available before this
|
|
;; tier loads, so they remain in Janet for now. Everything here is user-facing.
|
|
;;
|
|
;; Migration: remove the Janet core-X macro fn AND its core-macro-names entry when
|
|
;; moving a macro here (defmacro installs the :macro flag itself).
|
|
|
|
(defmacro comment [& body] nil)
|
|
|
|
;; Single arglist (Jolt defmacro is single-arity); the optional else defaults nil
|
|
;; via rest-destructuring.
|
|
(defmacro if-not [test then & [else]]
|
|
`(if (not ~test) ~then ~else))
|