== multimethod

Methods

==(a:Any, b:Any)
Always false. Other == method implementations should compare types they understand. If none of them can handle the comparison, objects are considered non-equal.

Returns

false
==(a:Type, b:Type)
Compare types. Implemented as sameness comparison.

Example

type T1; type T2; T1==T2  # false
==(a:UserDefinedMethod, b:UserDefinedMethod)
Compare closures. Implemented as sameness comparison.

Example

F make_closure() { F(x) x + 1 }; make_closure()      == make_closure()       # false - different objects
F make_closure() { F(x) x + 1 }; make_closure().ip() == make_closure().ip()  # true - same code
f = F(x) x +1; f == f  # true - same instance
==(a:Real, b:Real)
Compare floating point numbers. Using this operator/function is not recommended.
==(a:Bool, b:Bool)
Compare booleans
==(a:Str, b:Str)
Compare strings
==(a:Int, b:Int)
Equality comparison
==(a:NormalTypeInstance, b:NormalTypeInstance) Source: stdlib.ngs:820
Equality test for normal type instances: must be of same type and have same fields and their values

Returns

Bool

Example

type T
t1 = T()
t1.a = 1
t2 = T()
t2.a = 1
echo(t1 == t2)  # Outputs: true
==(a:Set, b:Set) Source: stdlib.ngs:2226
Undocumented
==(a:Null, b:Null) Source: stdlib.ngs:2798
Compare to null

Returns

true
==(a:Arr, b:Arr) Source: stdlib.ngs:2922
Arrays equality test. True if arrays are of the same length and all elements are equal (==)

Returns

Bool
==(a:Hash, b:Hash) Source: stdlib.ngs:3661
Compare two Hashes. Hashes must have same keys with same values in same order to return true. Both hashes must not be modified during comparison. This was not tested.

Returns

Bool
==(b1:Box, b2:Box) Source: stdlib.ngs:4378
Compare boxes. Empty boxes and boxes with same content are considered to be equal.

Returns

Bool

Example

EmptyBox() == EmptyBox()
EmptyBox() != FullBox(1)
FullBox(1) == FullBox(1)
FullBox(1) != FullBox(2)
==(a:Time, b:Time) Source: stdlib.ngs:8244
Undocumented
==(a:AWS::RouteBox, b:AWS::RouteBox)internal
Internal method. Please do not use.

Example

# TODO: example
==(a:AWS::IpPermBox, b:AWS::IpPermBox)internal
Internal method. Please do not use.
==(a:_RouteBox, b:_RouteBox)internal
Internal method. Please do not use.

Example

# TODO: example
==(a:_IpPermBox, b:_IpPermBox)internal
Internal method. Please do not use.