Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Development · Evolving reference

bool

Two logical values; no integer truthiness.

Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →

These examples describe the Development language contract. They are not a claim that every workflow is supported by the current public preview. Declaration excerpts belong inside a function unless a full module is shown.

Values and literals

The only valid logical values are true and false. They are keywords of type bool, not 1 and 0 integer aliases. A bool does not have a numeric range. Do not assume an arbitrary byte pattern is a valid bool or infer foreign ABI layout from its logical domain.

let Enabled: bool = true;
let Disabled = false;

Logical operators

Built-in operations are logical-not (!), lazy && / ||, and equality / inequality. && skips the right operand when left is false; || skips it when left is true. There is no built-in arithmetic or numeric ordering.

fn IsReady(Enabled: bool, Loaded: bool) -> bool {
    return Enabled && Loaded;
}
fn IsDisabled(Enabled: bool) -> bool { return !Enabled; }

Conditions and conversions

Conditions require a bool. Integers and pointers do not acquire C-style truthiness; compare explicitly. Optional success is matched explicitly rather than treated as a truthy number.

let Count: i32 = 3;
let HasItems: bool = Count > 0;
// Rejected: let Truth: bool = Count;

See all primitive types and literals and user-defined suffixes.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library