Created
January 20, 2023 18:46
-
-
Save yvern/cf27f30f9c282e9328cbe78261c49918 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 no-bangs! | |
[forms] | |
(if (->> forms | |
flatten | |
(filter symbol?) | |
(some (comp (partial re-find #"\!") name))) | |
(throw (ex-info "/(•̀o•́)ง No bangs!" {})) | |
forms)) | |
(no-bangs! | |
(defn show [a] (format "%s is ok!" a))) | |
(no-bangs! | |
(defn add! [a b] (+ a b))) | |
(no-bangs! | |
(defn div [a b] (/ a b))) | |
(no-bangs! | |
(defn mul [a b] (io! (* a b)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment