Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for if-then-else operator to expressions #4133

Open
zdila opened this issue Apr 2, 2020 · 1 comment
Open

Add support for if-then-else operator to expressions #4133

zdila opened this issue Apr 2, 2020 · 1 comment

Comments

@zdila
Copy link
Contributor

zdila commented Apr 2, 2020

I am missing ternary if-then-else expression operator (in C: cond ? trueExp : falseExp). I started to implement it but now I am struggling with it. Please see mapnik/mapnik-support#133 (comment). I will appceriate any hints to finish the implementation myself but also if somebody else would take it over.

@zdila
Copy link
Contributor Author

zdila commented Sep 22, 2022

For numeric values it can be emulated with cond * truthyValue + not(cond) * falsyValue. Not sure about strings.

Alternative implementation could use function: if(cond, truthyValue, falsyValue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant