File tree Expand file tree Collapse file tree 1 file changed +61
-14
lines changed Expand file tree Collapse file tree 1 file changed +61
-14
lines changed Original file line number Diff line number Diff line change 5
5
(java.util Date
6
6
UUID)))
7
7
8
- ; https://tonsky.me/blog/clojurefmt/#ok-what-do-we-do-then
8
+ ; Single ; comment
9
+ ; ; double ; comment
9
10
(when something
11
+ ; single ; comment
12
+ ; ; double ; comment
10
13
body)
11
14
12
15
(defmethod dispatch :on-me
47
50
#{a b c
48
51
d e f}
49
52
50
- ; second cond is not aligned
53
+
51
54
(or (condition-a )
52
55
(condition-b ))
53
56
54
- ; or/and are the only forms where this looks not ideal
55
- ; other forms don’t win/lose much because of this change
56
- (filter even?
57
- (range 1 10 ))
57
+ (filter even? (range 1 10 ))
58
58
59
- ; my way is actually better if fn name is looooooooooong
60
59
(clojure.core/filter even?
61
- (range 1 10 ))
60
+ (range 1 10 ))
61
+
62
62
63
- ; 1 additional space, no big deal
64
63
(filter
65
- even?
66
- (range 1 10 ))
64
+ even?
65
+ (range 1 10 ))
66
+
67
+ (asdf
68
+ asdf
69
+ asdf)
70
+
71
+ (defn foo [x 1 ]
72
+ x )
67
73
68
74
(:my/keyword
69
- {:my/keyword 1
70
- :another-keyword 2 }
71
- " default value" )
75
+ {:my/keyword 1
76
+ :another-keyword 2 }
77
+ " default value" )
78
+
79
+
80
+
81
+ (defprotocol IProto
82
+ (foo [this x])
83
+ (bar [this y]))
84
+
85
+ (deftype MyThing []
86
+ IProto
87
+ (foo [this x]
88
+ x))
89
+
90
+ (defrecord MyThingR []
91
+ IProto
92
+ (foo [this x] x))
93
+
94
+ (defn foo2 [x]b )
95
+
96
+ (reify
97
+ IProto
98
+ (foo [this x]
99
+ x))
100
+
101
+ (extend-type MyThing
102
+ clojure.lang.IFn
103
+ (invoke [this] 1 ))
104
+
105
+ (extend-protocol clojure.lang.IFn
106
+ MyThingR
107
+ (invoke [this]
108
+ 2 ))
109
+
110
+ (extend AType
111
+ AProtocol
112
+ {:foo an-existing-fn
113
+ :bar (fn [a b]
114
+ a)
115
+ :baz (fn
116
+ ([a] a)
117
+ ([a b]
118
+ b))})
You can’t perform that action at this time.
0 commit comments