mirror of
https://github.com/penpot/penpot.git
synced 2026-05-14 04:24:01 +00:00
🎉 Add ex/ignoring macro.
This commit is contained in:
parent
c85ae7dbdf
commit
0a34aa6231
@ -31,3 +31,17 @@
|
||||
(defmacro raise
|
||||
[& args]
|
||||
`(throw (error ~@args)))
|
||||
|
||||
(defn ignoring*
|
||||
[f]
|
||||
(try
|
||||
(f)
|
||||
(catch #?(:clj Exception :cljs :default) e
|
||||
nil)))
|
||||
|
||||
;; http://clj-me.cgrand.net/2013/09/11/macros-closures-and-unexpected-object-retention/
|
||||
;; Explains the use of ^:once metadata
|
||||
|
||||
(defmacro ignoring
|
||||
[& exprs]
|
||||
`(ignoring* (^:once fn* [] ~@exprs)))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user