Non-existing functions actually returning results

This is perhaps a non-issue if you know what you're doing, but (mistakingly) using non-existing functions returns non-expected results. For example, I would expect

$if($nonex(%test%,%example%),yes,no)

to be invalid or do nothing since the function $nonex doesn't exist. But it actually returns "yes" or "no" depending on the presence of %test% or %example%.

I noticed this when I tried the mac functions $gt(x,y) and $lt(x,y) in windows. I wasn't expecting them to work in windows, but at first they actually seemed to do so. After a while I noticed that they return identical results, which made me realize that they're not implemented in the windows version - they're only behaving as any non-existing function would.

I don't know if this is a bug or some kind of simplification in the program code, but in any case I find it confusing.

It's not that the function is returning any results, it's just not consumed by the parser. You could write

$nonex(text)

and it would just return this very same string. I agree that this might be obscured when nested inside $if(), though. However, I don't think that I'll change this anytime soon and I currently can't foresee the potential issues that would arise with such breaking change.

Understood.
These cases would be unusual (and mostly user errors) and I think you'd notice soon enough to correct. So it's a small issue and probably not worth any additional coding.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.