Menu

SyntaxExpression

Brad Lanam

Wiki Home
Syntax

Syntax: Expressions

Precedence of operators is the same as in the C language. The precedence of the eq~ and ne~ operators is the same as the other string operators.

Listed by precedence (high to low):

  • is_defined is_list
  • Unary: + ‑ !
  • * / %
  • + ‑
  • < <= > >= lt le gt ge
  • == != eq ne eq~ ne~
  • &&
  • ||
  • ..

Unary Operations on Integers

+ ‑ !

Binary Operations on Integers

+ ‑ * / % && || == != < <= > >=

Binary Operations on Strings

eq ne lt le gt ge eq~ ne~

eq~ applies the regular expression in the second operand to the first operand. If there is a match, true is returned, otherwise false is returned.

ne~ applies the regular expression in the second operand to the first operand. If there is no match, true is returned, otherwise false is returned.

Internal Functions

is_defined is_list

is_defined (variable‑name) returns true if the variable is defined.

is_list (variable‑name) returns true if the variable is defined and is a list.

Examples

set a 1 - 2;
set b 0;
set c ${a} && ${b};
if (${a} || ${b}) {
   print 'hello';
}

Wiki Home
Syntax


Related

Wiki: Home
Wiki: Syntax