core: start macro tier — move comment/if-not to the Clojure overlay (jolt-1j0 phase 3)
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.
This commit is contained in:
parent
f0e111563b
commit
330a3a23d9
4 changed files with 31 additions and 14 deletions
18
jolt-core/clojure/core/30-macros.clj
Normal file
18
jolt-core/clojure/core/30-macros.clj
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
;; 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))
|
||||
Loading…
Add table
Add a link
Reference in a new issue