Skip to content

Commit 42bb870

Browse files
committed
add simple-vector for now, might need to compiler support soon, but can use this util then
1 parent ac11735 commit 42bb870

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12322,6 +12322,12 @@ reduces them without incurring seq initialization"
1232212322

1232312323
(set! (. Vector -fromArray) (fn [xs] (Vector. nil xs nil)))
1232412324

12325+
(defn simple-vector
12326+
[& args]
12327+
(if (and (instance? IndexedSeq args) (zero? (.-i args)))
12328+
(.fromArray Vector (.-arr args) (not (array? (.-arr args))))
12329+
(vec args)))
12330+
1232512331
; The keys field is an array of all keys of this map, in no particular
1232612332
; order. Any string, keyword, or symbol key is used as a property name
1232712333
; to store the value in strobj. If a key is assoc'ed when that same

0 commit comments

Comments
 (0)