← Back to AILP Home

raw, drop, _!, and _?

These surfaces are explicit escape hatches. They make the programmer's intent visible when a Result is not being handled with a fallback.

raw expr and _! expr

raw extracts the success value field from a Result<T> and ignores the error state. _! is exactly the prefix shorthand for the same operation.

int32:a = raw maybe();
int32:b = _! maybe();

Use this when you have already proven the result is successful or when a test intentionally exercises the unchecked path.

Operand capture

raw and _! parse their operand at pipeline precedence, and v0.33.4 locked the two spellings as equivalent for pipeline-shaped operands.

drop expr and _? expr

drop evaluates an expression and discards its value. _? is exactly the prefix shorthand for the same operation.

drop setup();
_? setup();

This is the right spelling when a call returns a Result but only its side effects matter.

func:log = NIL() {
    println("log");
    pass NIL;
};

func:main = int32() {
    drop log();
    exit 0;
};

Value sink behavior

drop can also act as an explicit value sink for non-Result values. That is useful in tests or intentionally ignored computations.

_? 1i32 + 2i32;

Not RAII nodrop

raw is a Result-system unwrap. drop here is the explicit Result/value discard surface. They are separate from the RAII nodrop keyword, which opts managed region bindings out of automatic cleanup. See guide/drop/ for the RAII layer.