SplitScript reference / Equatable / equals

Equatable.equals

Operator

T.equals(other: T) -> bool where T: Equatable

Reports whether this value and another value are equal.

This method is also the implementation of the == operator. Records, enums, options, and results compare their complete structure; strings compare UTF-8 contents. Floating-point equality follows IEEE 754, so NaN is not equal to itself.

Parameters

  • other: The other value of the same type.

Effects: pure

Runtime behavior: available everywhere; synchronous

Examples

Compare two state values

let unchanged = 4u32 == 4u32