Expand description
pick — branched-dispatch primitive (library_catalog.md, “pick —
semantics”).
Signature: pick(b0, b1, …, bN-1, v0, v1, …, vN-1) -> V
Exactly one of the N selector booleans must be true at eval; the corresponding value is returned. Zero true and multiple-true both panic with a clear diagnostic — workload authors get a hard signal when their probe assumptions break, never a silent default.
The split-halves call shape (all booleans first, then all values) is used rather than interleaved pairs so long lists scan cleanly and a missing pair surfaces as “odd total args” at compile time (the spec’s “Argument shape”).
Structs§
- Pick
- Branched-dispatch primitive: select the value whose paired
selector is true. A split-halves variadic: the macro
recognises two consecutive
&[T]variadic args as a split-halves shape, emitsselectors.len()Bool slots followed byvalues.len()polymorphic slots (each pair(b_i, v_i)shares an index), and slicesinputsat the midpoint at eval time.