-
Notifications
You must be signed in to change notification settings - Fork 0
equal
ffredyk edited this page Jul 23, 2026
·
1 revision
Comparison
Binary — left == right.
<any> == <any>
Returns true if both operands are equal, false otherwise. For shared values, compares the unwrapped numeric values. For strings, uses ordinal comparison.
The host re-registers == with enhanced behavior:
- Shared values: unwraps and compares the underlying numbers.
- Strings: ordinal (byte-by-byte) comparison.
- Numbers: standard floating-point equality.
- Nil: compares equal only to nil.
- Arrays/HashMaps: reference equality (same object), not deep comparison.
- Code: reference equality.
if (_hp == 0) then { handleDeath(); };
if (_name == "player") then { ... };
if (_flag == true) then { ... };if (_value == nil) then {
_value = "default";
};shared _counter = 0;
if (get _counter == 10) then {
systemChat "Counter reached 10";
};_arr1 = [1, 2, 3];
_arr2 = [1, 2, 3];
_arr1 == _arr2; // false — different objects
_arr1 == _arr1; // true — same reference
// For content comparison, iterate or use string conversion
str _arr1 == str _arr2; // true — same contentReadOnly — pure comparison, no side effects. Safe from any scheduler.
- Getting Started
- Language Guide
- Type System
- Control Flow
- Functions & Code
- Strings & Text
- Arrays & Collections
- Concurrency
- Promise System
- Thread Safety
- Host API & Embedding
- CLI Tool
- Bytecode Reference
- Multiplayer
- Syntax Sugar
- Optimization Guide
- Benchmarks
- count
- select
- pushBack
- append
- deleteAt
- deleteRange
- resize
- reverse
- sort
- find
- in
- forEach
- freeze
- thaw
- isFrozen
- currentScheduler
- clientOwner
- allSchedulers
- schedulerName
- schedulerExists
- schedulerBudget
- setSchedulerBudget
- fiberCount
- readyFiberCount
- waitingFiberCount
- schedulerLoad
- sendTo