OxL Reference

data ab

Namespace of the experiment functions.

Example:

oxl✓ checked in CI
use std.ab { ab }

fn pick(q: str) -> str io {
  match ab.variant("search v2") {
    "b" => "new:{q}"
    _ => "old:{q}"
  }
}

fn main() io {
  print(pick("x"))
}
Output
old:x
pub(api) data ab

Thread safety. safe to call from any task; the answer depends only on the request the task is serving.

Since. 1.0.0-beta

Methods

variant(name: str) -> str io
The name of the variant of experiment name for the calling request ("a" / "b" as declared in test ab).

Defined in: std/ab/ab.oxl:63

See also