Skip to content

Instantly share code, notes, and snippets.

@ykochi
Last active December 24, 2015 17:16
Show Gist options
  • Select an option

  • Save ykochi/92feedd04a283ab6698e to your computer and use it in GitHub Desktop.

Select an option

Save ykochi/92feedd04a283ab6698e to your computer and use it in GitHub Desktop.
(defun ->-helper (forms)
(if (null forms)
nil
(let ((form (first forms))
(first-form (->-helper (rest forms))))
(if first-form
(append (list (first form))
(list first-form)
(rest form))
form))))
(defmacro -> (&rest forms)
(->-helper (reverse forms)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment