SPON_deepEquals v0.2.0
- Released: 2007-11-18
- SQF function in a single file
- Includes test mission, which is little more than a series of unit-tests/examples.
Description:
Compares any two values, including nil, null, arrays or nested arrays, for
equality. For our purposes, nils and nulls are considered equal to each
other, which is contrary to how this is done in ArmA (nil == nil,
objNull == objNull, controlNull == controlNull, displayNull == displayNull).
Parameters:
0: _a - The first value [Any type]
1: _b - The second value [Any type]
Returns:
True for equality, false otherwise.
Usage:
SPON_deepEquals = compile preprocessFileLineNumbers "SPON_deepEquals";
_same = [[1, nil, [3]], [1, nil, [3]]] call SPON_deepEquals; // Returns true
_same = [[1, nil, [3]], [1, [nil, 3]]] call SPON_deepEquals; // Returns false
Changelog:
0.2.0 No longer relies on the compiled function having a particular name.
Compares any type to any type.
Considers nils and nulls to be equivalent to themselves.
0.1.0 First release.