unwrap-as combines TryInto with unwrap.
Syntax
(unwrap-as ⟨type⟩ ⟨expr⟩)
(unwrap-as ⟨type⟩)
Semantics
- It attempts a
TryIntoconversion and then unwraps the resultingOptional. - Use it only when failure is genuinely exceptional.
- With one argument, it produces a unary function.
Example
(unwrap-as U16 exact-small-value)