ST
(defn make-thread
[body]
(doto (new Thread body)
(.start)))
😊
Size: a a a
ST
(defn make-thread
[body]
(doto (new Thread body)
(.start)))
KC
A
(defmacro with-thread
[& body]
`(let [thread# (new Thread (fn [] ~@body))]
(.start thread#)
thread#))
(def t (with-thread (println 42)))
(.join t)
(defn make-thread
[body]
(let [t (new Thread body)]
(.start t)
t))
(def t (make-thread #(println 42)))
(.join t)
(defn make-thread [body]
(doto (Thread. body)
(.start)))
Можно не писать макросы, но использовать всё же стоит)TL
TL
(defn make-thread [body]
(doto (Thread. body)
(.start)))
Можно не писать макросы, но использовать всё же стоит)KC
KC
AC
AC
DL
DL
AC
DL
AC
DF
IG
(defn wrap-safe [func]
(fn [& args]
(try
(apply func args)
(catch Exception e))))
IG
(some-> "aaa" ((wrap-safe slurp)))
IG
(some-> "project.clj" ((wrap-safe slurp)))
;; (defproject...
Г