|
610 | 610 | `(when-not (exists? ~x)
|
611 | 611 | (def ~x ~init)))
|
612 | 612 |
|
613 |
| -(core/defn destructure [bindings] |
| 613 | +(core/defn- destructure [bindings] |
614 | 614 | (core/let [bents (partition 2 bindings)
|
615 | 615 | pb (core/fn pb [bvec b v]
|
616 | 616 | (core/let [pvec
|
|
779 | 779 | (let ~(vec (interleave bs gs))
|
780 | 780 | ~@body)))))))
|
781 | 781 |
|
782 |
| -(def fast-path-protocols |
| 782 | +(def #^:private fast-path-protocols |
783 | 783 | "protocol fqn -> [partition number, bit]"
|
784 | 784 | (zipmap (map #(symbol "cljs.core" (core/str %))
|
785 | 785 | '[IFn ICounted IEmptyableCollection ICollection IIndexed ASeq ISeq INext
|
|
797 | 797 | :cljs (core/* 2 b))]))
|
798 | 798 | [0 1])))
|
799 | 799 |
|
800 |
| -(def fast-path-protocol-partitions-count |
| 800 | +(def #^:private fast-path-protocol-partitions-count |
801 | 801 | "total number of partitions"
|
802 | 802 | (core/let [c (count fast-path-protocols)
|
803 | 803 | m (core/mod c 32)]
|
|
862 | 862 | `(not (nil? ~x)))
|
863 | 863 |
|
864 | 864 | ;; internal - do not use.
|
865 |
| -(core/defmacro coercive-not [x] |
| 865 | +(core/defmacro ^:private coercive-not [x] |
866 | 866 | (bool-expr (core/list 'js* "(!~{})" x)))
|
867 | 867 |
|
868 | 868 | ;; internal - do not use.
|
869 |
| -(core/defmacro coercive-not= [x y] |
| 869 | +(core/defmacro ^:private coercive-not= [x y] |
870 | 870 | (bool-expr (core/list 'js* "(~{} != ~{})" x y)))
|
871 | 871 |
|
872 | 872 | ;; internal - do not use.
|
873 |
| -(core/defmacro coercive-= [x y] |
| 873 | +(core/defmacro ^:private coercive-= [x y] |
874 | 874 | (bool-expr (core/list 'js* "(~{} == ~{})" x y)))
|
875 | 875 |
|
876 | 876 | ;; internal - do not use.
|
877 |
| -(core/defmacro coercive-boolean [x] |
| 877 | +(core/defmacro ^:private coercive-boolean [x] |
878 | 878 | (with-meta (core/list 'js* "~{}" x)
|
879 | 879 | {:tag 'boolean}))
|
880 | 880 |
|
881 | 881 | ;; internal - do not use.
|
882 |
| -(core/defmacro truth_ [x] |
| 882 | +(core/defmacro ^:private truth_ [x] |
883 | 883 | (core/assert (core/symbol? x) "x is substituted twice")
|
884 | 884 | (core/list 'js* "(~{} != null && ~{} !== false)" x x))
|
885 | 885 |
|
886 | 886 | ;; internal - do not use
|
887 |
| -(core/defmacro js-arguments [] |
| 887 | +(core/defmacro ^:private js-arguments [] |
888 | 888 | (core/list 'js* "arguments"))
|
889 | 889 |
|
890 |
| -(core/defmacro js-delete [obj key] |
| 890 | +(core/defmacro ^:private js-delete [obj key] |
891 | 891 | (core/list 'js* "delete ~{}[~{}]" obj key))
|
892 | 892 |
|
893 |
| -(core/defmacro js-in [key obj] |
| 893 | +(core/defmacro ^:private js-in [key obj] |
894 | 894 | (core/list 'js* "~{} in ~{}" key obj))
|
895 | 895 |
|
896 |
| -(core/defmacro js-debugger |
| 896 | +(core/defmacro ^:private js-debugger |
897 | 897 | "Emit JavaScript \"debugger;\" statement"
|
898 | 898 | []
|
899 | 899 | (core/list 'do
|
900 | 900 | (core/list 'js* "debugger")
|
901 | 901 | nil))
|
902 | 902 |
|
903 |
| -(core/defmacro js-comment |
| 903 | +(core/defmacro ^:private js-comment |
904 | 904 | "Emit a top-level JavaScript multi-line comment. New lines will create a
|
905 | 905 | new comment line. Comment block will be preceded and followed by a newline"
|
906 | 906 | [comment]
|
|
914 | 914 | (reduce core/str ""))
|
915 | 915 | " */\n"))))
|
916 | 916 |
|
917 |
| -(core/defmacro unsafe-cast |
| 917 | +(core/defmacro ^:private unsafe-cast |
918 | 918 | "EXPERIMENTAL: Subject to change. Unsafely cast a value to a different type."
|
919 | 919 | [t x]
|
920 | 920 | (core/let [cast-expr (core/str "~{} = /** @type {" t "} */ (~{})")]
|
921 | 921 | (core/list 'js* cast-expr x x)))
|
922 | 922 |
|
923 |
| -(core/defmacro js-inline-comment |
| 923 | +(core/defmacro ^:private js-inline-comment |
924 | 924 | "Emit an inline JavaScript comment."
|
925 | 925 | [comment]
|
926 | 926 | (core/list 'js* (core/str "/**" comment "*/")))
|
|
1127 | 1127 | ([x y & more] `(bit-and (bit-and ~x ~y) ~@more)))
|
1128 | 1128 |
|
1129 | 1129 | ;; internal do not use
|
1130 |
| -(core/defmacro ^::ana/numeric unsafe-bit-and |
| 1130 | +(core/defmacro ^:private ^::ana/numeric unsafe-bit-and |
1131 | 1131 | ([x y] (bool-expr (core/list 'js* "(~{} & ~{})" x y)))
|
1132 | 1132 | ([x y & more] `(unsafe-bit-and (unsafe-bit-and ~x ~y) ~@more)))
|
1133 | 1133 |
|
|
1171 | 1171 | (core/list 'js* "(~{} | (1 << ~{}))" x n))
|
1172 | 1172 |
|
1173 | 1173 | ;; internal
|
1174 |
| -(core/defmacro mask [hash shift] |
| 1174 | +(core/defmacro ^:private mask [hash shift] |
1175 | 1175 | (core/list 'js* "((~{} >>> ~{}) & 0x01f)" hash shift))
|
1176 | 1176 |
|
1177 | 1177 | ;; internal
|
1178 |
| -(core/defmacro bitpos [hash shift] |
| 1178 | +(core/defmacro ^:private bitpos [hash shift] |
1179 | 1179 | (core/list 'js* "(1 << ~{})" `(mask ~hash ~shift)))
|
1180 | 1180 |
|
1181 | 1181 | ;; internal
|
1182 |
| -(core/defmacro caching-hash [coll hash-fn hash-key] |
| 1182 | +(core/defmacro ^:private caching-hash [coll hash-fn hash-key] |
1183 | 1183 | (core/assert (clojure.core/symbol? hash-key) "hash-key is substituted twice")
|
1184 | 1184 | `(let [h# ~hash-key]
|
1185 | 1185 | (if-not (nil? h#)
|
|
1373 | 1373 | ~type ~(with-meta `(fn ~@meths) (meta form))))
|
1374 | 1374 | sigs))))
|
1375 | 1375 |
|
1376 |
| -(core/defmulti extend-prefix (core/fn [tsym sym] (core/-> tsym meta :extend))) |
| 1376 | +(core/defmulti ^:private extend-prefix (core/fn [tsym sym] (core/-> tsym meta :extend))) |
1377 | 1377 |
|
1378 | 1378 | (core/defmethod extend-prefix :instance
|
1379 | 1379 | [tsym sym] `(.. ~tsym ~(to-property sym)))
|
|
1608 | 1608 | (vary-meta (cons f (map #(cons (second %) (nnext %)) sigs))
|
1609 | 1609 | merge annots)))
|
1610 | 1610 |
|
1611 |
| -(core/defn dt->et |
| 1611 | +(core/defn- dt->et |
1612 | 1612 | ([type specs fields]
|
1613 | 1613 | (dt->et type specs fields false))
|
1614 | 1614 | ([type specs fields inline]
|
|
2644 | 2644 | (~print-fn (str ~bs-str ", " ~expr-str ", "
|
2645 | 2645 | ~iterations " runs, " elapsed# " msecs"))))))
|
2646 | 2646 |
|
2647 |
| -(def cs (into [] (map (comp gensym core/str core/char) (range 97 118)))) |
| 2647 | +(def #^:private cs (into [] (map (comp gensym core/str core/char) (range 97 118)))) |
2648 | 2648 |
|
2649 | 2649 | (core/defn- gen-apply-to-helper
|
2650 | 2650 | ([] (gen-apply-to-helper 1))
|
|
2661 | 2661 | ~(gen-apply-to-helper (core/inc n))))
|
2662 | 2662 | `(throw (js/Error. "Only up to 20 arguments supported on functions"))))))
|
2663 | 2663 |
|
2664 |
| -(core/defmacro gen-apply-to [] |
| 2664 | +(core/defmacro ^:private gen-apply-to [] |
2665 | 2665 | `(do
|
2666 | 2666 | (set! ~'*unchecked-if* true)
|
2667 | 2667 | (defn ~'apply-to [~'f ~'argc ~'args]
|
|
2691 | 2691 | [& colls]
|
2692 | 2692 | `(concat ~@(map #(core/list `lazy-seq %) colls)))
|
2693 | 2693 |
|
2694 |
| -(core/defmacro js-str [s] |
| 2694 | +(core/defmacro ^:private js-str [s] |
2695 | 2695 | (core/list 'js* "''+~{}" s))
|
2696 | 2696 |
|
2697 |
| -(core/defmacro es6-iterable [ty] |
| 2697 | +(core/defmacro ^:private es6-iterable [ty] |
2698 | 2698 | `(aset (.-prototype ~ty) cljs.core/ITER_SYMBOL
|
2699 | 2699 | (fn []
|
2700 | 2700 | (this-as this#
|
|
2832 | 2832 | `(~'ns* ~(cons :refer-clojure args)))
|
2833 | 2833 |
|
2834 | 2834 | ;; INTERNAL - do not use, only for Node.js
|
2835 |
| -(core/defmacro load-file* [f] |
| 2835 | +(core/defmacro ^:private load-file* [f] |
2836 | 2836 | `(. js/goog (~'nodeGlobalRequire ~f)))
|
2837 | 2837 |
|
2838 | 2838 | (core/defmacro macroexpand-1
|
|
2901 | 2901 | (set! (. ~sym ~'-cljs$lang$applyTo)
|
2902 | 2902 | ~(apply-to)))))))
|
2903 | 2903 |
|
2904 |
| -(core/defmacro copy-arguments [dest] |
| 2904 | +(core/defmacro ^:private copy-arguments [dest] |
2905 | 2905 | `(let [len# (alength (js-arguments))]
|
2906 | 2906 | (loop [i# 0]
|
2907 | 2907 | (when (< i# len#)
|
|
0 commit comments