981 B
981 B
Logical and Comparison Expressions
Decodal supports boolean logic over concrete Bool values and comparison over concrete scalar values.
{
is_prod = env == "prod";
high_port = port > 9000;
enabled = is_prod && high_port;
disabled = !enabled;
}
Logical operators
!exprnegates a concreteBool.lhs && rhsreturns boolean AND.lhs || rhsreturns boolean OR.
&& and || short-circuit: the right-hand side is evaluated only when needed.
Logical operands must evaluate to concrete Bool values.
Comparison operators
==!=<<=>>=
== and != compare concrete scalar values: String, Bool, Int, and Float.
Int and Float can be compared to each other numerically.
Ordering operators <, <=, >, and >= compare concrete numeric values only.
They are separate from prefix comparison constraints such as > 443.
port = Int & > 443 default 9443;
is_high = port > 9000;