-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with loading macros #128
Comments
Related #62 |
I'll try putting everything under the |
Nevermind, similar error even after doing that. I don't think #62 was actually fixed
|
That's why I put everything into one |
I'll try and fix this for good soon, just focusing on some Conjure stuff at the moment. |
Loving the work on conjure, for now I just moved everything into one file and it works perfectly. Take your time, no worries |
So I think this was to do with Aniseed not creating intermediate directories when copying macro files over into your compiled lua output directory. I've since fixed that and I can now refer to nested macro files! If you can still reproduce it, please let me know. I'm trying to reproduce it still but I feel like I'm missing something. I think I've fixed one issue but there may be another lurking that I can't quite repro. |
So this works, but you NEED to use import-macros, if you just If this statement is wrong and this does work in some other system please let me know! But I think the only way to load other macro files into your macro file and use them is to use import-macros etc. I've fixed the nested dirs of macros issue, so maybe that was it? Here's a small snippet of me requiring a sub-macro file and using it. It works for me! Although not super useful, I think it's just a limitation of Fennel, you can't just infinitely require and next macros and have it resolve them all as you would in Clojure... I think. I could just be wrong! ; (local {: bad-add} (require :./misc.other-macros.fnl))
(import-macros {: bad-add} :dotfiles.misc.other-macros)
{:adder-b (fn [a b]
`(+ 1 ,a ,b ,(bad-add 1 2)))
... |
@Olical |
Yep! That sounds like the same problem! Which to me sounds like a Fennel
usage problem? Like we need to work out patterns that work for Fennel. I
don't think I can work around that limitation?
I think I've fixed aniseeds bug to do with nested dirs though!
…On Thu, 25 Aug 2022, 00:03 Thanh Dung TRUONG, ***@***.***> wrote:
@Olical <https://github.com/Olical>
Might related to
rktjmp/hotpot.nvim#76 <rktjmp/hotpot.nvim#76>
—
Reply to this email directly, view it on GitHub
<#128 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACM6XKKGA7GL66QETGSFCTV22S4VANCNFSM5522DVZA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
We're now on fennel 1.2.0 on the develop branch, not sure if that helps at all... |
edit: sorry, just assumed this issue was about cljlib because it was linked!, not the broader (x-post from hotpot issue) I think if you use this fork https://github.com/rktjmp/fennel-cljlib/ cljlib should now work? The install instructions have changed since this was opened, you how have to set the Internally it makes a direct (let [root (vim.fn.stdpath :config)
path (.. root :/fnl/cljlib)]
(set package.path (string.format "%s;%s;%s"
(.. path "/?/init.lua")
;; readme doesn't say to add this one but it's idiomatic to include both the `?.lua` and `?/init.lua` paths.
(.. path "/?.lua")
package.path)))
(local clj (require :cljlib))
(import-macros cljm :cljlib)
(print (clj.add 1 2 3))
(cljm.time (do
(for [i 1 10000000] i)))
I just cloned it into Hopefully the patch can be up streamed, have to check with Andre if he has opinions on the change. (note this doesn't fix calling `(require :some-macro) inside a import-macro in aniseed/hotpot obviously, imo that behaviour is out of spec) |
Considering |
Hi, I'm trying out aniseed again on my config, which you can see here: https://github.com/shaunsingh/nyoom.nvim/tree/aniseed-support
The macros in question are here: https://github.com/shaunsingh/nyoom.nvim/tree/aniseed-support/fnl/macros
Essentially, aniseed can recognize
command-macros
event-macros
and all of the top-level macros just fine. However, those depend on other macros as well: these which aniseed can't find. How should I proceed with this, is this something aniseed should solve or rather is there a certain way I should name/redo those macros?Here is the resulting error:
The text was updated successfully, but these errors were encountered: