Replies: 2 comments 4 replies
-
@jlaurens as has been stated before this is supporting the initial design where the call is
and so build.lua is read first and those two forms are not equivalent as build.lua can define main (as in fact the latex2e one does) So yes it could be changed but it would be a breaking change not cosmetic "cleanup" that doesn't mean that we shouldn't do it, but it is not as simple a decision as you seem to suggest. |
Beta Was this translation helpful? Give feedback.
-
I follow the query but come to a very different conclusion :) The aim here was that The need for a Probably, today with the |
Beta Was this translation helpful? Give feedback.
-
I really mean
Should
main
be a global lua variable the user can define inbuild*.lua
?This question came around because in
l3build.lua
, there is amain = main or stdmain
instruction instead of an equivalentmain = stdmain
. It appeared that it was a reminiscence of a former design now abandoned.What remains is that
main
can be redefined inbuild.lua
and this is not documented, neither publicly nor in source code, is it intentional? It was definitely at some point but is it still relevant?I see 2 ways of defining a global
main
inbuild.lua
, a complete rewrite or a wrapper.A wrapper defined in
build.lua
would read something likeThat would be advantageously replaced by some kind of global
before_main_hook(...)
andafter_main_hooks(...)
(there are some hooks already). BTW, I would find more appropriate to havewill_process(target, options)
anddid_process(target, options)
.The complete rewrite really means touching seriously the core of
l3build
. I guess that renamingbuild.lua
intol3build.lua
in a repository and runningtexlua l3build.lua
instead ofl3build
would work the same at a reasonable cost. Of course some supplemental header would be required in the locall3build.lua
. Some refactoring could reduce this header to only a pair of lines.At that point, it seems to me that in the future
main
should not be exposed publicly and should remain an implementation detail if any, provided some compensation like hooks. I am afraid I missed something.Beta Was this translation helpful? Give feedback.
All reactions