Skip to content

Instantly share code, notes, and snippets.

@laat
Last active December 17, 2020 22:58
Show Gist options
  • Save laat/4505a9f60d36f9ac137763c3cf14827f to your computer and use it in GitHub Desktop.
Save laat/4505a9f60d36f9ac137763c3cf14827f to your computer and use it in GitHub Desktop.

The times macro

(defmacro laat/times (n fn arg) 
  (cons 'thread-last (cons arg (cl-loop for i below n collect fn))))
(laat/times 3 sqrt 256)

expands to

(sqrt (sqrt (sqrt 256)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment