Skip to content

Instantly share code, notes, and snippets.

@yvern
Created January 20, 2023 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yvern/cf27f30f9c282e9328cbe78261c49918 to your computer and use it in GitHub Desktop.
Save yvern/cf27f30f9c282e9328cbe78261c49918 to your computer and use it in GitHub Desktop.
(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