Created
April 2, 2020 12:59
-
-
Save gabbigum/e033175ed4773a03156b240fddd4fa26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro report | |
[to-try] | |
`(if ~to-try | |
(println (quote ~to-try) "was successful:" ~to-try) | |
(println (quote ~to-try) "was not successful:" ~to-try))) | |
;; Thread/sleep takes a number of milliseconds to sleep for | |
(report (do (Thread/sleep 1000) (+ 1 1))) | |
produces that | |
(if (do (Thread/sleep 1000) (+ 1 1)) | |
(println '(do (Thread/sleep 1000) (+ 1 1)) | |
"was successful:" | |
(do (Thread/sleep 1000) (+ 1 1))) | |
(println '(do (Thread/sleep 1000) (+ 1 1)) | |
"was not successful:" | |
(do (Thread/sleep 1000) (+ 1 1)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment