Ternary Operator

Ternary Operator — ( ? : )

Syntax

condition ? s_exp : s_exp
		

Arguments

condition

Any Gamma or Lisp expression.

s_exp

Any Gamma or Lisp expression.

Returns

The first s_exp if the condition is true, otherwise the second s_exp.

Examples

Gamma> a = t ? 2 : 8;
2
Gamma> a;
2
Gamma> b = (a == 7) ? 2 : 8;
8
Gamma> b;
8
Gamma>