-
Notifications
You must be signed in to change notification settings - Fork 212
Difference between luafile and lua require #1
Comments
Thanks! I had your issue in mind when writing this, it's part of what prompted me to start the guide My understanding of the differences if you're not doing anything with modules is basically the same as yours:
I'm far from being a Lua expert though, so there might be other things to take into account. It'd be good to add a section explaining these differences, although I would expect |
I was wondering whether it was a coincidence that it addressed so many of my questions directly :)
I think it's sufficient to make a brief remark on this in the section on (Not sure it'll become obsolete, although that depends on how exactly |
First of all, wonderful write-up! It really fills a hole in the current documentation (and pretty much closes my neovim issue about the lack of such a high-level overview: neovim/neovim#12369)
One question I still have is about the practical difference between
:lua require'foo'
and:luafile PATH_TO_FOO.LUA
. Is it just about the explicit path for the latter and the machinery that prevents loading twice for the former? (Assuming thatfoo.lua
is a single lua script, nothing fancy involving modules.)The text was updated successfully, but these errors were encountered: