Comparison and equality
Comparison
We can compare values using C style comparison operators:
Equality
Of same types
We can test two values for equality:
Example
And for inequality:
Example
Of different types
We can test different types for equality (which will, by default, always evaluate to false
).
Example
And for inequality (which will, by default, always evaluate to true
).
Example
Checking 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
Last updated