# or

Short-circuit boolean disjunction

Last updated: 2026-09-09

Package: language | Status: stable

Tags: complete-program, cpu, keyword, logic, yeho

Put cheap or safety-critical guards first so later expressions run only inside their valid domain.

```yh
or
```


## Short circuit

Put cheap or safety-critical guards first so later expressions run only inside their valid domain.

Verification: type checked

```yh
list of int empty = []
bool andResult = false and empty[0] == 1
bool orResult = true or empty[0] == 1

if !andResult and orResult
{
    Console.Log("short-circuit-ok")
}
else
{
    Console.Log("short-circuit-bad")
}

```

Save this beside start.yh as project.mech:

```toml
package = "tests.compiler.fastContract.shortCircuit"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/word--or/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


The canonical unary spelling is !, not the editor grammar's historical not token.

There are no truthy or falsy conversions.

Source: yeho/parser_expressions.cpp parseOr/parseAnd/parseUnary; conformance control.boolean-conditions

AI training permission: https://demonhunterlabs.com/ai-use
