File tree 2 files changed +40
-1
lines changed
2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 1
- (defproject jtk-dvlp /core.async-helpers " 3.1 .0-SNAPSHOT"
1
+ (defproject jtk-dvlp /core.async-helpers " 3.2 .0-SNAPSHOT"
2
2
:description
3
3
" Helper pack for core.async"
4
4
Original file line number Diff line number Diff line change
1
+ (ns jtk-dvlp.async.print
2
+ #? (:cljs
3
+ (:require-macros
4
+ [jtk-dvlp.async.print :refer [<debug <println <pprint]]))
5
+
6
+ #? (:clj
7
+ (:require
8
+ [jtk-dvlp.async]
9
+ [clojure.pprint])
10
+
11
+ :cljs
12
+ (:require
13
+ [jtk-dvlp.async]
14
+ [cljs.pprint])))
15
+
16
+
17
+ #?(:clj
18
+ (defmacro <debug
19
+ [print-fn <form]
20
+ `(jtk-dvlp.async/go
21
+ (try
22
+ (~print-fn (jtk-dvlp.async/<! ~<form))
23
+ (catch :default e#
24
+ (~print-fn e#))))))
25
+
26
+ #?(:clj
27
+ (defmacro <println
28
+ [<form]
29
+ `(<debug println ~<form)))
30
+
31
+ #?(:clj
32
+ (defmacro <pprint
33
+ [<form]
34
+ (let [pprint
35
+ (if (:ns &env)
36
+ 'cljs.pprint/pprint
37
+ 'clojure.pprint/pprint)]
38
+
39
+ `(<debug ~pprint ~<form))))
You can’t perform that action at this time.
0 commit comments