[Rpm-maint] [rpm-software-management/rpm] Introduce convenient %gsub macro to wrap Lua's string.gsub() (#1764)
Miro Hrončok
notifications at github.com
Wed Nov 17 15:32:45 UTC 2021
> Regarding making lua functions easier to access: it would not be hard to add function support to the expression parser:
>
> ```
> %[lua:gsub("aaa", "a", "b", 2)]
> ```
>
> Just a thought...
Since `gsub()` is a method of string, would this expose string methods only, or would the actual call need to be `%[lua:string.gsub("aaa", "a", "b", 2)]`?
And considering I need to apply this method on macro value, would I need to do `%[lua:string.gsub(macros.foo, "a", "b", 2)]`? That is not such a big improvement over `%{lua:print((string.gsub(macros.foo, "a", "b", 2)))}`.
--
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/1764#issuecomment-971694224
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20211117/b5d88b2e/attachment.html>
More information about the Rpm-maint
mailing list