unreduced retrieves the value inside a Reduced object. When given an ordinary value, it returns that value unchanged, making it safe for code that may receive either form. section 7.3
Use unreduced when processing reduction results or values that may carry an early-termination marker:
- A Reduced object can be inspected with @r, (deref r), or (unreduced r); all three retrieve its payload. section 7.3
- Unlike reduced, unreduced does not add a wrapper; unlike ensure-reduced, it removes one when present. section 7.3
Extracting a reduced value
(def r (reduced "string")) (unreduced r) ;; "string" (unreduced 42) ;; 42 section 7.3
