Soliciting some opinions on how BoxLang should handle the “not” operator, which can be the actual word not
or an exclamation point (!
). In most other languages (Java, JavaScript, PHP, Ruby, C/C+/C#, Swift. Typescript, Go) the not operator attaches itself directly to the next immediate expression it comes before. Therefore, code like this
!foo == bar
does the following
- negate the
foo
variable - then compares the result of step 1 with
bar
In other words, it’s the same as
(!foo) == bar
However, ColdFusion is a little special unicorn, because the same code behaves like so
- first compare
foo
andbar
- THEN, negate the result
In other words:
!( foo == bar )
The only language I found that matched CF is Python, which also uses a not
operator.
So, here’s the question. If we were making a dynamic JVM language from scratch in 2024, would we want to follow CF/Python’s example, or go with what most other languages do?
Of course, we’ll provide transpilation in our cf compat module so your CF code runs the same, but as far as BoxLang source code goes, should we break this precedent or keep it?
Related ticket - BL-663