Expressions - Compound Expression - Relational Operators and Comparison Operators
Describe the feature
The usual <,>,<=,>=,==,!= kind of relations...
Describe the solution you would like
Semantic Meaning of "<": "less than" in terms of logical equivalence."
Returns: True or False.
Example:
a = 5
b = 5
a < 5 ==> False
Semantic Meaning of ">": "greater than" in terms of logical equivalence."
Returns: True or False.
Example:
a = 5
b = 5
a > 5 ==> False
Semantic Meaning of "==": "equivalent to" in terms of logical equivalence."
Returns: True or False.
Example:
a = 5
b = 5
a == 5 ==> True
Semantic Meaning of "!=": "not equivalent to" in terms of logical equivalence."
Returns: True or False.
Example:
a = 5
b = 5
a != 5 ==> False
Semantic Meaning of "<=": "less than or equivalent to: in terms of logical equivalence."
Returns: True or False.
Example:
a = 5
b = 5
a <= 5 ==> True
Semantic Meaning of ">=": "greater than or equivalent to: in terms of logical equivalence."
Returns: True or False.
Example:
a = 5
b = 5
a >= 5 ==> True
<NOT TO BE USED> Semantic Meaning of "is": "object comparison of is thisObject 'THE' SAME OBJECT AS thatObject
from an address prospective"
Returns: True or False
Example:
a = 5
b = 5
listAB = []
listAB.append(a)
listAB.append(b)
logic1_1 = 5 in listAB ==> True
logic1_2 = 5 not in listAB ==> False
logic2 = 5 is 5 ==> True
logic3_1 = b is listAB[0] ==> True
logic3_2 = b is listAB[1] ==> True
logic4 = [a,b] is listAB ==> False
[a,b]: [5,5]
listAB: [5,5]
<NOT TO BE USED> Semantic Meaning of "is not": "object comparison of is thisObject NOT 'THE' SAME OBJECT AS thatObject
from an address prospective"
Returns: True or False.
Example: logic5 = [a,b] is not listAB ==> True
Semantic Meaning of "in": "check if object / field value IS in this list"
Returns: True or False.
Example: logic1_1 = 5 in listAB ==> True
Semantic Meaning of "not in": "check if object / field value IS NOT in this list"
Returns: True or False.
Example: logic1_2 = 5 not in listAB ==> False
=================================================
With respect to a conditional-ternary-expression:
=================================================
Semantic Meaning of "?": "if the condition-expression is true then then use the ifTrue-expression to resolve the value.
Semantic Meaning of ":" "if the condition-expression is not true then use the ifFalse-expression to resolve the value.
<conditional-ternary-expression> ::= <condition-expression> '?' <ifTrue-expression> ':' <ifFalse-expression>
Returns: Value.
Example: egoLane -> LaneChoice == "Left" ? Lane1 : Lane3
Example Context: LaneChoice does equal "Left"
Example Resultant: egoLane -> Lane1
https://medium.com/swlh/the-one-liner-if-statement-kinda-87318a85eef1
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator
condition-expression
An expression whose value is used as a condition.
exprIfTrue-expression
An expression which is evaluated if the condition evaluates to a true value (condition-expresion has a value is converted to true).
exprIfFalse-expression
An expression which is executed if the condition is false (condition-expresion has a value which is converted to false).
=====================================
With Respect to resolving a value
=====================================
Semantic Meaning of "->": "This field resolves to the following value."
Returns: a value assignment to a field.
Example: egoLane -> LaneChoice == "Left" ? Lane1 : Lane3
Example Context: LaneChoice does equal "Left"
Example Resultant: egoLane -> Lane1
=====================================
Type Checking
=====================================
Semantic Meaning of ".is(<type>)": "checks object to see if the object IS of the defined type.
Returns: True or False
Example:
v1: Vehicle
v1IsVehicle = v1.is(Vehicle)
Example Resultant: v1IsVehicle is True
Other Possibilities: ".oftype(<type>)"
<DO NOT USE> Semantic Meaning of ".isnt(<type>)": "checks object to see if the object IS NOT of the defined type.
Returns: True or False
Example:
v1: Vehicle
v1IsntPerson = v1.isnt(Person)
Example Resultant: v1IsntPerson is True
INSTEAD: not v1.is(Person)