[Rpm-maint] [rpm-software-management/rpm] RFE: macros as arrays/sets/dicts (Issue #1825)

Michael Schroeder notifications at github.com
Thu Nov 11 09:38:33 UTC 2021


Oh, I think I need to be a bit more specific so that you know exactly what I did:

1) a new %{foreach macroname iteration_body} builtin:

This expands the specified macro, splits it with the argument split code and then expands the iteration_body with %1 set to the array elements. This is kind of unrelated to the rest.

2) a way to create "meta" macros called "objects"

The idea is that the "opts" element of the macro contains the "type". `%{obj method args}` is a shorthand for `%{_type_method obj args}`. `%{obj}` uses an implicit `_expand` method and falls back to the macro body if it does not exist.

I also added two builtins to set/get the macro body so that the implementation of the type can stash data into it.

We can certainly use something else for the syntax. (But note that just using the first arg has the advantage that it can be used in  `rpmExpandThisMacro()`)

3) I used the above to create array/set/dict implementations.


-- 
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/issues/1825#issuecomment-966152068
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20211111/e2e5fe98/attachment.html>


More information about the Rpm-maint mailing list