ddekany commented on PR #111: URL: https://github.com/apache/freemarker/pull/111#issuecomment-2253012705
What I'm saying that the standard way of checking if `s` is `null` is `s??`, and the standard way of giving a default if `s` is `null` like `s!'my default'`. However alien they look, too late, you have to get used to them if you use FreeMarker. And also, sometimes you want to treat a blank `s` as if it was `null`, because really it should be `null`, but the data source you receive it from doesn't normalize it. So if there was a `?blank_to_null` that normalizes blank to `null`, then this unwanted difference can be removed. And after that, `s?blank_to_null??` and `s?blank_to_null!'my default'` will just work. Only it's a bit too verbose. Back then I considered if there should be an operator to do this (like `s~`, where `~` is the operator), but that's yet another alien symbol, plus, there's the variant where you only want to normalize 0-length strings to `null`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
