Skip to content

Instantly share code, notes, and snippets.

@emanon-was
Last active November 25, 2023 20:15
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emanon-was/ed12f6023e2d6328334a to your computer and use it in GitHub Desktop.
Save emanon-was/ed12f6023e2d6328334a to your computer and use it in GitHub Desktop.
(define-syntax ->
(syntax-rules ()
((_ x) x)
((_ x (form more ...)) (form x more ...))
((_ x form) (form x))
((_ x form more ...) (-> (-> x form) more ...))))
(define-syntax ->>
(syntax-rules ()
((_ x) x)
((_ x (form more ...)) (form more ... x))
((_ x form) (form x))
((_ x form more ...) (->> (->> x form) more ...))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment