castleproject / NVelocity

Castle's NVelocity
Other
57 stars 33 forks source link

NVelocity does not support the text variants of logical operators #7

Open dpupek opened 6 years ago

dpupek commented 6 years ago

So far I can find no way of getting Nvelocity to support the text variants of the logical operators. Here are some examples from velocity:

Operator Text variant
&& and
\|\| or
! not
jonorossi commented 6 years ago

NVelocity isn't Velocity, NVelocity is a port of Velocity from over 10 years ago so is missing many of the Velocity changes since then, and has some of its own changes. This project has been unmaintained for years until only 2 weeks ago when someone wanted to reboot it.

I checked the Velocity docs and those text variants aren't mentioned there, I assume they are fairly new. However, feel free to contribute a pull request adding support.

dpupek commented 6 years ago

From the docs:

There are text versions of all logical operators, including eq, ne, and, or, not, gt, ge, lt, and le.

You just need to read a little further. I may be willing to port this if it's just missing.

image

dpupek commented 6 years ago

Another example from the docs: http://velocity.apache.org/engine/devel/vtl-reference.html#ifelseifelse-output-conditional-on-truth-of-statements

jonorossi commented 6 years ago

You just need to read a little further.

Apologies, I missed that paragraph in the middle of the block which I skim read thinking it was about not, couldn't exactly search for "and", "or" or "not", and they didn't use the term "variant".

jonorossi commented 6 years ago

Another example from the docs:

Yer, I checked that page first and noticed that "&&" and "||" aren't even on there, neither are "and" and "or".

dpupek commented 6 years ago

No worries...I did a little research and it seems like the text variants show up in 1.6. I'm pretty sure that NVelocity predates that:

http://velocity.apache.org/engine/1.6/vtl-reference-guide.html#aifelseifelse_-_Output_conditional_on_truth_of_statements