Skip to main content

switch

Macro switch 

Source
macro_rules! switch {
    (live $name:expr, $default:expr) => { ... };
    ($name:expr, $default:expr) => { ... };
}
Expand description

One on/off switch (consolidation S1): switch!("BREP_X", default) reads BREP_X through its call site’s once-cell ([env_read::switch], kept for the process while BREP_ENV_READ_ONCE is on); switch!(live "BREP_X", default) reads it on every call, for a variable a probe sets at run time. One grammar (owner decision 2026-11-01): 0|off|false off, 1|on|true on, unset or anything else the default. In the kernel’s tests one keyed override (env_read::with_switch_for_test) forces either form.