File tree 3 files changed +17
-13
lines changed
3 files changed +17
-13
lines changed Original file line number Diff line number Diff line change 2
2
:description " Persistent Data Structures for JavaScript"
3
3
4
4
:dependencies [[org.clojure/clojure " 1.6.0" ]
5
- [org.clojure/clojurescript " 0.0-3169 " ]]
5
+ [org.clojure/clojurescript " 0.0-3178 " ]]
6
6
7
7
:plugins [[lein-cljsbuild " 1.0.5" ]]
8
8
Original file line number Diff line number Diff line change 62
62
63
63
(defn ^:export flatten [x]
64
64
(cljs.core/filter #(not (sequential-or-array? %))
65
- (cljs.core/rest (tree-seq sequential-or-array? seq x))))
65
+ (cljs.core/rest (tree-seq sequential-or-array? cljs.core/ seq x))))
66
66
67
67
; The real lazy-seq is a macro, but it just expands its body into a function
68
68
(defn ^:export lazySeq [f]
153
153
(mori-export comp cljs.core/comp)
154
154
155
155
(defn ^:export pipeline [& args]
156
- (reduce #(%2 %1 ) args))
156
+ (cljs.core/ reduce #(%2 %1 ) args))
157
157
158
158
(defn ^:export curry [fun & args]
159
159
(fn [arg]
160
- (cljs.core/apply fun (cons arg args))))
160
+ (cljs.core/apply fun (cljs.core/ cons arg args))))
161
161
162
162
(defn ^:export juxt [& fns]
163
163
(fn [& args]
164
- (into-array (map #(cljs.core/apply % args) fns))))
164
+ (cljs.core/ into-array (cljs.core/ map #(cljs.core/apply % args) fns))))
165
165
166
166
(defn ^:export knit [& fns]
167
167
(fn [args]
168
- (into-array (map #(% %2 ) fns args))))
168
+ (cljs.core/ into-array (cljs.core/ map #(% %2 ) fns args))))
169
169
170
170
; ; Useful fns
171
171
Original file line number Diff line number Diff line change 18
18
(defmacro mori-export [exportf coref]
19
19
(let [{:keys [ns name methods]} (ana-api/resolve &env coref)]
20
20
`(do
21
- (def ~(vary-meta exportf assoc :export true ) ~coref )
21
+ (js/goog.exportSymbol ~(str " mori. " ( core/name exportf)) ~coref) ~( list 'js* " ; " )
22
22
~@(when-not (= 1 (count methods))
23
23
(map
24
24
(fn [{:keys [variadic max-fixed-arity]}]
25
25
(if variadic
26
- `(js/goog.exportSymbol
27
- ~(str ana/*cljs-ns* " ." (core/name exportf) " .fn" )
28
- ~(symbol (str ns ) (str (core/name name) " .cljs$core$IFn$_invoke$variadic" )))
29
- `(js/goog.exportSymbol
30
- ~(str ana/*cljs-ns* " ." (core/name exportf) " .f" max-fixed-arity)
31
- ~(symbol (str ns ) (str (core/name name) " .cljs$core$IFn$_invoke$arity$" max-fixed-arity)))))
26
+ `(do
27
+ (js/goog.exportSymbol
28
+ ~(str " mori." (core/name exportf) " .fn" )
29
+ ~(symbol (str ns ) (str (core/name name) " .cljs$core$IFn$_invoke$variadic" )))
30
+ ~(list 'js* " ;" ))
31
+ `(do
32
+ (js/goog.exportSymbol
33
+ ~(str " mori." (core/name exportf) " .f" max-fixed-arity)
34
+ ~(symbol (str ns ) (str (core/name name) " .cljs$core$IFn$_invoke$arity$" max-fixed-arity)))
35
+ ~(list 'js* " ;" ))))
32
36
methods)))))
33
37
34
38
(comment
You can’t perform that action at this time.
0 commit comments