API Reference › Builtin functions › is_some
function

is_some

is_some(o: option) -> bool

Returns true when an option holds a value (it is some, not none) — the guard before acting on an optional target or slot.

Parameters

othe option to test

Example

program AI {
  handler Step phase Update {
    let target = none()
    if is_some(target) { chase(unwrap_or(target, 0)) }
  }
}
← All symbols