(sigil fp chain)
(sigil fp chain) - Threading Macros
Thread values through sequences of expressions, similar to Clojure's threading macros and SRFI-197.
Basic Threading
(import (sigil fp chain))
;; Thread-first (no placeholder needed)
(chain 5 (+ 3) (* 2))
; => 16 (same as (* (+ 5 3) 2))
;; Explicit placeholder with _
(chain '(1 2 3)
(map (lambda (x) (* x 2)) _)
(apply + _))
; => 12Short-Circuit Threading
;; Returns #f if any step produces #f
(some-> user
(dict-ref _ name:)
(string-split " " _)
car)