Skip to content

Equal

Compare values for equality.

$ wo 'Equal[1, 1]'
True
$ wo 'Equal[1, 2]'
False
$ wo 'Equal[1, 1, 1]'
True

==

Check if values are equal to each other.

$ wo '2 == 2'
True
$ wo 'x = 2; x == 2'
True
$ wo '2 == 3'
False

Equal only answers when its operands are comparable. True, False and Null are each their own kind, so comparing one with a number, a string or a list has no value and stays as written — it is not False:

$ wo '1 == True'
1 == True
$ wo '1 == Null'
1 == Null

Comparisons within one kind do resolve:

$ wo 'True == False'
False
$ wo 'Null == Null'
True

In a chain, the parts that hold drop away and only the undecidable remainder comes back:

$ wo '2 > 1 == True'
1 == True