Remix.run Logo
zelphirkalt 5 days ago

Ah neat! In Guile I use threading/pipelining all the time with a small macro:

    (define-syntax ->
      (syntax-rules ()
        ;; first expression is left unchanged
        [(-> expr) expr]
        ;; take from the back, wrap other calls
        [(-> expr* ... (op args* ...))
         (op args* ... (-> expr* ...))]
        ;; make parens unnecessary in trivial case of no further arguments
        [(-> expr* ... op)
         (op (-> expr* ...))]))
Janet already having this ... Reading many good things about Janet in this discussion.