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


next up previous contents index
Next: Assignment Expressions Up: Expressions Previous: Relational Expressions

Logical Expressions

The binary | and & perform boolean ``or" and ``and", respectively. They require boolean operands and yield boolean results. They work in the usual fashion with equal-sized vector operands or one vector and one scalar. (See § 3.2.4, page [*].)

In addition to | and &, Glish provides the related || and && operators, taken from C. These are ``short-circuit'' operators; they evaluate their right-hand operand only when needed. Unlike most of the other operands, these do not perform element-by-element vector operations. Both operands should be numeric scalars, though presently vector values are allowed, in which case the first element of the vector is used.

The || operator evaluates its first operand and returns the result if the result resolves to true when considered as a boolean. Otherwise, it evaluates and returns its second operand. The && operator returns F if its first operand evaluates to false, otherwise it evaluates and returns its second operand.


next up previous contents index
Next: Assignment Expressions Up: Expressions Previous: Relational 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