Or(...) vs or

Status
Not open for further replies.
Level 12
Joined
Mar 13, 2012
Messages
1,121
So, there is
JASS:
native Or         takes boolexpr operandA, boolexpr operandB returns boolexpr
and the keyword "or". Are there differences between these two?

Same applies for And(...) and "and".
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
And, Or, Not are very good if you have one(for not) or 2 boolexprs you want to execute back to back and dont want to suffer overhead from trigger creation and deletion. Other than that, they are useless garbage.

As PNF said, or, and and not work on booleans, so true, false, !=, ==, ... and Or, Not and And work on boolexprs, so basically on functions
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,241
If you can have boolexpr type global variables then you can use the natives for dynamic filters.

For example, you could apply filters from a boolexpr array with an accompanying size value. Filters could then be added, removed or re-ordered dynamically during a session.

Of course this could be done by evaluating the boolexprs into boolean variables and then using the appropriate in-built operators on them however those cannot be used as trigger conditions. As such the above native operators can be used to dynamically create trigger conditions (if JASS works as it should, which is often not the case).

Is it useful? Not really since the use case is probably very rare and can often be worked around about as efficiently.
 
Status
Not open for further replies.
Top