Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit 3e1a235

Browse files
committed
doc: Document status quo regarding == and != operator behavior
1 parent 1959515 commit 3e1a235

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

doc/sphinx/reference/vcl.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,27 @@ The following operators are available in VCL:
103103
``&&`` / ``||``
104104
Logical and/or.
105105

106+
On Equality
107+
~~~~~~~~~~~
108+
109+
In this section, "compare equal" means that the ``==`` operator returns ``true``
110+
and, conversely, the ``!=`` operator returns ``false``.
111+
112+
The VCL types ``INT``, ``DURATION``, ``BYTES``, ``REAL`` and ``TIME`` compare
113+
equal if their values compare equal numerically.
114+
115+
Notice that ``DURATION``, ``REAL`` and ``TIME`` are represented as floating
116+
point numbers, and hence testing for (in)equality might be unreliable.
117+
118+
``IP`` compares equal for equal address.
119+
120+
``STRING`` and ``STRANDS`` compare equal if the represented strings are equal.
121+
122+
``BOOL`` compares equal if the truth value is the same.
123+
124+
The VCL types ``BACKEND``, ``ACL``, ``PROBE``, ``STEVEDORE``, ``SUB`` and
125+
``INSTANCE`` compare equal if they represent the same object. Different objects
126+
with the same properties will never compare equal.
106127

107128
Conditionals
108129
------------

0 commit comments

Comments
 (0)