(meval form)Expands to the result of (eval form). Useful for manipulating the order of compile-time evaluation, thereby potentially improving ergonomics of code generation. Also handy for writing bizarre, illegible, or weirdly buggy code; please use with caution. See comments aracadia/internal/macro.clj for examples of expansion, and potential resulting bugs.
form(defn-meval name & tail-forms-and-code-form)Macro for generating function definitions. Uses include generating many arities for a function. The final form in tail-forms-and-code-form will be evaluated at expansion time and spliced into the body of the function. Example: (am/defn-meval backwards-subtract "an amazing function" (for [i (range 3) :let [args (vec (repeatedly i gensym))]] `(~args ~(cons '- (reverse args))))) expands to: (clojure.core/defn backwards-subtract "an amazing function" ([] (-)) ([G__26409] (- G__26409)) ([G__26410 G__26411] (- G__26411 G__26410))) I've found vectors useful data structures for generating arities, since it is easy to generate all the default cases, then use update to modify them for special cases, such as 0, 1, and 20/more-than-19 arguments.
nametail-forms-and-code-form(classy-arg-strs)(classy-arg-strs n)n(classy-args)(classy-args n)n(arities-forms base-fn)(arities-forms base-fn {:keys [:arcadia.internal.macro/max-args :arcadia.internal.macro/cases :arcadia.internal.macro/arg-fn], :or {:arcadia.internal.macro/max-args 20, :arcadia.internal.macro/cases {}, :arcadia.internal.macro/arg-fn (fn* [p1__84888#] (gensym (str "arg-" (inc p1__84888#) "_")))}})base-fn(condcast-> expr xsym & clauses)exprxsymclauses