[Rpm-maint] [rpm-software-management/rpm] Ternary op discussions (#852)

Michael Schroeder notifications at github.com
Mon Sep 23 12:12:05 UTC 2019

Here are some points to discuss:

1) The ternary op currently uses the same logic as rpmExprBool to evaluate if the condition is true or not. But the other logical operators (!, &&, ||) only work with integers. We should make this consistent, either by changing ternary to only accept integers or by changing the other ops to also accept strings.

2) There probably should be a test that makes sure the true and false part of a ternary op have the same type. I.e. the `%test ? 2 : "foo"` should not be allowed.

3) Does it make sense to have variants with missing parts?

%foo ? %bar         Use alternate value
                    Return %bar if %foo is true, otherwise 0 or ""
                    (probably not so interesting, it's easy to write `: 0` or `: ""`)
%foo ?: %bar        Use default value
                    Return %foo if %foo is true, otherwise %bar

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20190923/dc94f7bb/attachment.html>

More information about the Rpm-maint mailing list