Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: Logical Expressions Up: Expressions Previous: Arithmetic Expressions


Relational Expressions

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 == e
prints 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.


next up previous contents index
Next: Logical Expressions Up: Expressions Previous: Arithmetic Expressions   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15