fix array creation for cljs

This commit is contained in:
Nathan Marz 2015-12-16 01:03:39 -05:00
parent 41f42e20a1
commit 3073f1256b
2 changed files with 4 additions and 2 deletions

View file

@ -3,13 +3,13 @@
(defn gensyms [amt]
(vec (repeatedly amt gensym)))
(defmacro define-ParamsNeededPath [fn-type invoke-name var-arity-impl]
(defmacro define-ParamsNeededPath [clj? fn-type invoke-name var-arity-impl]
(let [a (with-meta (gensym "array") {:tag 'objects})
impls (for [i (range 21)
:let [args (vec (gensyms i))
setters (for [j (range i)] `(aset ~a ~j ~(get args j)))]]
`(~invoke-name [this# ~@args]
(let [~a (com.rpl.specter.impl/fast-object-array ~i)]
(let [~a (~(if clj? 'com.rpl.specter.impl/fast-object-array 'object-array) ~i)]
~@setters
(com.rpl.specter.impl/bind-params* this# ~a 0)
)))]

View file

@ -92,6 +92,7 @@
#+clj
(dh/define-ParamsNeededPath
true
clojure.lang.IFn
invoke
(applyTo [this args]
@ -100,6 +101,7 @@
#+cljs
(define-ParamsNeededPath
false
cljs.core/IFn
-invoke
(-invoke [this p01 p02 p03 p04 p05 p06 p07 p08 p09 p10