Skip to content

Commit 87ce235

Browse files
committed
Use partial to define record predicates, which is better for certain code analysis tools.
1 parent 611cd09 commit 87ce235

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/active/clojure/cljs/record_cljs_internals.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@
363363

364364
;; Predicate
365365
(def ~(r-help/add-meta (r-help/add-predicate-doc type predicate docref) meta-data)
366-
(fn [x#] (instance? ~type x#)))
366+
(partial instance? ~type))
367367

368368
;; Constructor
369369
(def ~(r-help/add-meta (r-help/add-constructor-doc constructor constructor-args type field-triples) meta-data)

src/active/clojure/record_clj_internals.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@
355355

356356
;; Predicate
357357
(def ~(r-help/add-meta (r-help/add-predicate-doc type predicate ?docref) meta-data)
358-
(fn [x#] (instance? ~type x#)))
358+
(partial instance? ~type))
359359

360360

361361
;; Constructor

0 commit comments

Comments
 (0)