File tree 2 files changed +18
-9
lines changed
test/clojure/test_clojure
2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -6244,13 +6244,6 @@ fails, attempts to require sym's namespace and retries."
6244
6244
([m k f x y z & more]
6245
6245
(assoc m k (apply f (get m k) x y z more))))
6246
6246
6247
- (defn empty?
6248
- " Returns true if coll has no items - same as (not (seq coll)).
6249
- Please use the idiom (seq x) rather than (not (empty? x))"
6250
- {:added " 1.0"
6251
- :static true }
6252
- [coll] (not (seq coll)))
6253
-
6254
6247
(defn coll?
6255
6248
" Returns true if x implements IPersistentCollection"
6256
6249
{:added " 1.0"
@@ -6306,6 +6299,16 @@ fails, attempts to require sym's namespace and retries."
6306
6299
:static true }
6307
6300
[coll] (instance? clojure.lang.Counted coll))
6308
6301
6302
+ (defn empty?
6303
+ " Returns true if coll has no items. To check the emptiness of a seq,
6304
+ please use the idiom (seq x) rather than (not (empty? x))"
6305
+ {:added " 1.0"
6306
+ :static true }
6307
+ [coll]
6308
+ (if (counted? coll)
6309
+ (zero? (count coll))
6310
+ (not (seq coll))))
6311
+
6309
6312
(defn reversible?
6310
6313
" Returns true if coll implements Reversible"
6311
6314
{:added " 1.0"
Original file line number Diff line number Diff line change 1136
1136
{}
1137
1137
#{}
1138
1138
" "
1139
- (into-array []) )
1139
+ (into-array [])
1140
+ (transient [])
1141
+ (transient #{})
1142
+ (transient {}))
1140
1143
1141
1144
(are [x] (not (empty? x))
1142
1145
'(1 2 )
1145
1148
{:a 1 :b 2 }
1146
1149
#{1 2 }
1147
1150
" abc"
1148
- (into-array [1 2 ]) ))
1151
+ (into-array [1 2 ])
1152
+ (transient [1 ])
1153
+ (transient #{1 })
1154
+ (transient {1 2 })))
1149
1155
1150
1156
1151
1157
(deftest test-every?
You can’t perform that action at this time.
0 commit comments