Closed D00mch closed 2 years ago
Can you not require-macros [macros]
? I can't remember right now and I'll look deeper tomorrow but you shouldn't need the fnl
prefix, maybe some old documentation told you to do that?
Also I would recommend moving your modules under a sub-directory so they're not directly under fnl/lua. That risks your file / module names colliding with other things at the top level, maybe it'll be fine, but I think it's good practice to have something like fnl/dotfiles/my-code.fnl
.
Yes, I guess the problem is in the fnl prefix, which I get from the docs. I removed it but now I have
This error with the macros from the fennel-lang.org/macros
{:thrice-if2
(fn [condition body]
(fn step [i]
(if (< i 3
`(if ,condition (do ,body ,(step (+ 1 i))))))
(step 0)))
For example, if I announce the same macro with macro keyword, I can use it int the same module:
(macro thrice-if [condition body]
(fn step [i]
(if (< i 3)
(list (sym :if) condition (list (sym :do) body (step (+ 1 i))))))
(step 0))
I had a typo. So, everything words, if you provide path without fnl.
prefix.
Aniseed from master. macros.fnl is copied to .confgi/nvim/lua/macros.fnl