Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
You can compare values using ==
, !=
, <
, <=
,
>
, and <=
, which have their usual meanings. For numeric
and string values, each operates element-by-element when given two
equal-sized vectors, or pairs a scalar with every element of a vector
in turn yielding a boolean vector as the result. Logical operators
applied to arrays operate the same way but return an array rather than
a vector. (See § 3.2.5, page .)
Other types (record, function, agent)
can compare values for equality (==
) and inequality (!=
).
The values are considered equal if they refer to exactly the same entity;
the comparison yields a scalar boolean value. For example,
a := [b=1, c=2] d := [b=1, c=2] e := ref a print a == a, a == d, a == eprints T, F, T. In the future, Glish may support field-by-field comparison of record values, in which case the second F printed above would instead be T.