[Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)
Panu Matilainen
notifications at github.com
Mon Oct 19 09:26:42 UTC 2020
Now that the table version exists, I don't feel any particular need to hang on to the multi-argument auto-join thing. The convenience of not having to manually and tediously construct the string was the point of that, but since *that* can be avoided with the table syntax, eliminating the string catenation neatly eliminates the problem of quoting - it's simply up to the caller. I'll update that part.
As for builtins, I know. One possibility would be hiding the different calling convention in the call, so eg `rpm.expand("%{uncompress:...}")` becomes just `macros.uncompress(...)`, but I actually think it'd be saner to expose them via an entirely different "namespace" because builtins can't be overridden, so they'd need annoying extra checks in the macros table. Maybe `builtin.uncompress(...)` or something.
The macro argument expansion is a stickier issue because it's a rather fundamental part of the parametric macro calling convention. If different means of calling the same macro can behave differently, it can create strange situations (and bugs). I think. Note that I've been toying with an idea of some sort of "native Lua macro" concept that would by definition bypass the normal %{1} etc argument processing and just call the other macro as a normal Lua function, but that's just a very vague idea at this point.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1398#issuecomment-711905618
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201019/f8d517cc/attachment-0001.html>
More information about the Rpm-maint
mailing list