-
Notifications
You must be signed in to change notification settings - Fork 11
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
[Feature Proposal] Separate macros from normal scripts #30
Comments
@alexmozaidze After some prototyping and thinking about the proposed solution, I have decided to not add a separate tangerine.setup {
compiler = {
adviser = function(fennel)
local dir = vim.fn.stdpath [[config]] .. "/macros"
local path = string.format(";%s/?.fnl;%s/?/init-macros.fnl", dir, dir)
fennel["macro-path"] = fennel["macro-path"] .. path
return fennel
end,
}
} |
Works wonders, thanks! I have to wonder, is there a benefit to returning (or (config.adviser fennel) fennel) This would make the function more fool-proof. |
@alexmozaidze I don't like adding indirection in code, so I would leave it as is. I don't expect normal users to ever touch this feature anyways. |
Problem
Currently, in order to mark a file as a macro, you are required to suffix it with
-macros.fnl
, which is not ideal.Normal script files and macro files get mixed up, ending up in a hard-to-read project structure.
Proposal
Separate normal files and macro files into
fnl/
andmacros/
folders respectively.Doing so would make it easier to understand which files are to be treated as macros, and which need to be compiled into Lua.
The text was updated successfully, but these errors were encountered: