File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1083
1083
(deftype* ~t ~fields ~pmasks
1084
1084
~(if (seq impls)
1085
1085
`(extend-type ~t ~@(dt->et t impls fields))))
1086
+ (set! (.-getBasis ~t) (fn [] '[~@fields]))
1086
1087
(set! (.-cljs$lang$type ~t) true )
1087
1088
(set! (.-cljs$lang$ctorStr ~t) ~(core/str r))
1088
1089
(set! (.-cljs$lang$ctorPrWriter ~t) (fn [this# writer# opt#] (-write writer# ~(core/str r))))
1238
1239
assoc :internal-ctor true )]
1239
1240
`(let []
1240
1241
~(emit-defrecord &env rsym r fields impls)
1242
+ (set! (.-getBasis ~r) (fn [] '[~@fields]))
1241
1243
(set! (.-cljs$lang$type ~r) true )
1242
1244
(set! (.-cljs$lang$ctorPrSeq ~r) (fn [this#] (core/list ~(core/str r))))
1243
1245
(set! (.-cljs$lang$ctorPrWriter ~r) (fn [this# writer#] (-write writer# ~(core/str r))))
Original file line number Diff line number Diff line change 2771
2771
(is (= (destructure-1216 1 2 3 4 )[1 2 [3 4 ]]
2772
2772
(apply destructure-1216 [1 2 3 4 ])))))
2773
2773
2774
+ (deftype TypeBasis [a b])
2775
+
2776
+ (defrecord RecordBasis [c d e])
2777
+
2778
+ (deftest test-get-basis
2779
+ (is (= (.getBasis TypeBasis) '[a b]))
2780
+ (is (= (.getBasis RecordBasis) '[c d e])))
2781
+
2774
2782
(comment
2775
2783
; ; ObjMap
2776
2784
; ; (let [ks (map (partial str "foo") (range 500))
You can’t perform that action at this time.
0 commit comments