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:
https://github.com/rpm-software-management/rpm/issues/852
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to