diff --git a/jolt-core/clojure/core/00-syntax.clj b/jolt-core/clojure/core/00-syntax.clj index a76a958..101241f 100644 --- a/jolt-core/clojure/core/00-syntax.clj +++ b/jolt-core/clojure/core/00-syntax.clj @@ -60,6 +60,10 @@ ;; pending cells (matching the prior Janet macro). (defmacro declare [& syms] `(do)) +;; fn -> fn*: the analyzer treats fn* as the primitive (it handles params, &-rest, +;; multi-arity); fn is just the public spelling. +(defmacro fn [& args] `(fn* ~@args)) + ;; A fresh jolt symbol inside a macro body (a bare (gensym) returns a Janet symbol ;; the destructurer rejects). This defn compiles fine: by the time a tier triggers ;; the analyzer build the kernel is in place (the build is gated until then). diff --git a/src/jolt/core.janet b/src/jolt/core.janet index c5542af..50522c0 100644 --- a/src/jolt/core.janet +++ b/src/jolt/core.janet @@ -2354,14 +2354,6 @@ # declare macro — accepts symbols, does nothing (forward declaration) -(defn core-fn - "Macro: (fn [args] body) → (fn* [args] body)" - [& args] - (def result @[]) - (array/push result {:jolt/type :symbol :ns nil :name "fn*"}) - (each a args (array/push result a)) - result) - # --- Destructuring expansion (Clojure's `destructure`) ----------------------- # Expands a binding vector containing destructuring patterns into a plain binding # vector (alternating plain-symbol / init-form), using nth/nthnext/get. Shared by @@ -3432,7 +3424,6 @@ "remove-all-methods" core-remove-all-methods "prefer-method" core-prefer-method "Object" core-Object - "fn" core-fn "let" core-let "loop" core-loop "defprotocol" core-defprotocol @@ -3496,7 +3487,7 @@ (defn core-macro-names "Set of core binding names that are macros." [] - @{"when-let" true "defn" true "defn-" true "fn" true "let" true "loop" true "defrecord" true "defprotocol" true "extend-type" true "extend-protocol" true "extend" true "reify" true "proxy" true "definterface" true "lazy-seq" true "lazy-cat" true}) + @{"when-let" true "defn" true "defn-" true "let" true "loop" true "defrecord" true "defprotocol" true "extend-type" true "extend-protocol" true "extend" true "reify" true "proxy" true "definterface" true "lazy-seq" true "lazy-cat" true}) (def init-core! (fn [& args]