diff --git a/nvim/.config/nvim/fnl/config/macros.fnl b/nvim/.config/nvim/fnl/config/macros.fnl new file mode 100644 index 0000000..f53371c --- /dev/null +++ b/nvim/.config/nvim/fnl/config/macros.fnl @@ -0,0 +1,14 @@ +;; [nfnl-macro] + +(fn tx [& args] + "Mixed sequential and associative tables at compile time. Because the Neovim ecosystem loves them but Fennel has no neat way to express them (which I think is fine, I don't like the idea of them in general)." + (let [to-merge (when (table? (. args (length args))) + (table.remove args))] + (if to-merge + (do + (each [key value (pairs to-merge)] + (tset args key value)) + args) + args))) + +{: tx}