Comparison and equality
Comparison
We can compare values using C style comparison operators:
less < than
lessThan <= orEqual
greater > than
greaterThan >= orEqualEquality
Of same types
We can test two values for equality:
Example
1 == 2 //false
"2" is "2" //trueAnd for inequality:
Example
1 not 2 //true
"2" != "2" //falseOf different types
We can test different types for equality (which will, by default, always evaluate to false).
Example
314 == "pi" // false
123 is "123" // falseAnd for inequality (which will, by default, always evaluate to true).
Example
314 not "pi" // true
123 != "123" // trueChecking type
In Hades, the equality operator also works as a typecheck. You can check any value against a proto or type. The operation will return true if the value is an instance of said proto.
Example
123 == int // true
var v = VideoStream("bigbuckbunny.mp4")
v is Vector // falseLast updated