|
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 ^:private fast-path-protocols |
| 782 | +(def 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 ^:private fast-path-protocol-partitions-count |
| 800 | +(def 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)] |
|
861 | 861 | (core/defmacro some? [x] |
862 | 862 | `(not (nil? ~x))) |
863 | 863 |
|
864 | | -;; internal - do not use. |
865 | | -(core/defmacro ^:private coercive-not [x] |
| 864 | +(core/defmacro coercive-not [x] |
866 | 865 | (bool-expr (core/list 'js* "(!~{})" x))) |
867 | 866 |
|
868 | | -;; internal - do not use. |
869 | | -(core/defmacro ^:private coercive-not= [x y] |
| 867 | +(core/defmacro coercive-not= [x y] |
870 | 868 | (bool-expr (core/list 'js* "(~{} != ~{})" x y))) |
871 | 869 |
|
872 | | -;; internal - do not use. |
873 | | -(core/defmacro ^:private coercive-= [x y] |
| 870 | +(core/defmacro coercive-= [x y] |
874 | 871 | (bool-expr (core/list 'js* "(~{} == ~{})" x y))) |
875 | 872 |
|
876 | | -;; internal - do not use. |
877 | | -(core/defmacro ^:private coercive-boolean [x] |
| 873 | +(core/defmacro coercive-boolean [x] |
878 | 874 | (with-meta (core/list 'js* "~{}" x) |
879 | 875 | {:tag 'boolean})) |
880 | 876 |
|
881 | 877 | ;; internal - do not use. |
882 | | -(core/defmacro ^:private truth_ [x] |
| 878 | +(core/defmacro truth_ [x] |
883 | 879 | (core/assert (core/symbol? x) "x is substituted twice") |
884 | 880 | (core/list 'js* "(~{} != null && ~{} !== false)" x x)) |
885 | 881 |
|
886 | | -;; internal - do not use |
887 | | -(core/defmacro ^:private js-arguments [] |
| 882 | +(core/defmacro js-arguments [] |
888 | 883 | (core/list 'js* "arguments")) |
889 | 884 |
|
890 | | -(core/defmacro ^:private js-delete [obj key] |
| 885 | +(core/defmacro js-delete [obj key] |
891 | 886 | (core/list 'js* "delete ~{}[~{}]" obj key)) |
892 | 887 |
|
893 | | -(core/defmacro ^:private js-in [key obj] |
| 888 | +(core/defmacro js-in [key obj] |
894 | 889 | (core/list 'js* "~{} in ~{}" key obj)) |
895 | 890 |
|
896 | | -(core/defmacro ^:private js-debugger |
| 891 | +(core/defmacro js-debugger |
897 | 892 | "Emit JavaScript \"debugger;\" statement" |
898 | 893 | [] |
899 | 894 | (core/list 'do |
900 | 895 | (core/list 'js* "debugger") |
901 | 896 | nil)) |
902 | 897 |
|
903 | | -(core/defmacro ^:private js-comment |
| 898 | +(core/defmacro js-comment |
904 | 899 | "Emit a top-level JavaScript multi-line comment. New lines will create a |
905 | 900 | new comment line. Comment block will be preceded and followed by a newline" |
906 | 901 | [comment] |
|
914 | 909 | (reduce core/str "")) |
915 | 910 | " */\n")))) |
916 | 911 |
|
917 | | -(core/defmacro ^:private unsafe-cast |
| 912 | +(core/defmacro unsafe-cast |
918 | 913 | "EXPERIMENTAL: Subject to change. Unsafely cast a value to a different type." |
919 | 914 | [t x] |
920 | 915 | (core/let [cast-expr (core/str "~{} = /** @type {" t "} */ (~{})")] |
921 | 916 | (core/list 'js* cast-expr x x))) |
922 | 917 |
|
923 | | -(core/defmacro ^:private js-inline-comment |
| 918 | +(core/defmacro js-inline-comment |
924 | 919 | "Emit an inline JavaScript comment." |
925 | 920 | [comment] |
926 | 921 | (core/list 'js* (core/str "/**" comment "*/"))) |
|
1127 | 1122 | ([x y & more] `(bit-and (bit-and ~x ~y) ~@more))) |
1128 | 1123 |
|
1129 | 1124 | ;; internal do not use |
1130 | | -(core/defmacro ^:private ^::ana/numeric unsafe-bit-and |
| 1125 | +(core/defmacro ^::ana/numeric unsafe-bit-and |
1131 | 1126 | ([x y] (bool-expr (core/list 'js* "(~{} & ~{})" x y))) |
1132 | 1127 | ([x y & more] `(unsafe-bit-and (unsafe-bit-and ~x ~y) ~@more))) |
1133 | 1128 |
|
|
1171 | 1166 | (core/list 'js* "(~{} | (1 << ~{}))" x n)) |
1172 | 1167 |
|
1173 | 1168 | ;; internal |
1174 | | -(core/defmacro ^:private mask [hash shift] |
| 1169 | +(core/defmacro mask [hash shift] |
1175 | 1170 | (core/list 'js* "((~{} >>> ~{}) & 0x01f)" hash shift)) |
1176 | 1171 |
|
1177 | 1172 | ;; internal |
1178 | | -(core/defmacro ^:private bitpos [hash shift] |
| 1173 | +(core/defmacro bitpos [hash shift] |
1179 | 1174 | (core/list 'js* "(1 << ~{})" `(mask ~hash ~shift))) |
1180 | 1175 |
|
1181 | 1176 | ;; internal |
1182 | | -(core/defmacro ^:private caching-hash [coll hash-fn hash-key] |
| 1177 | +(core/defmacro caching-hash [coll hash-fn hash-key] |
1183 | 1178 | (core/assert (clojure.core/symbol? hash-key) "hash-key is substituted twice") |
1184 | 1179 | `(let [h# ~hash-key] |
1185 | 1180 | (if-not (nil? h#) |
|
1608 | 1603 | (vary-meta (cons f (map #(cons (second %) (nnext %)) sigs)) |
1609 | 1604 | merge annots))) |
1610 | 1605 |
|
1611 | | -(core/defn- dt->et |
| 1606 | +(core/defn dt->et |
1612 | 1607 | ([type specs fields] |
1613 | 1608 | (dt->et type specs fields false)) |
1614 | 1609 | ([type specs fields inline] |
|
2661 | 2656 | ~(gen-apply-to-helper (core/inc n)))) |
2662 | 2657 | `(throw (js/Error. "Only up to 20 arguments supported on functions")))))) |
2663 | 2658 |
|
2664 | | -(core/defmacro ^:private gen-apply-to [] |
| 2659 | +(core/defmacro gen-apply-to [] |
2665 | 2660 | `(do |
2666 | 2661 | (set! ~'*unchecked-if* true) |
2667 | 2662 | (defn ~'apply-to [~'f ~'argc ~'args] |
|
2691 | 2686 | [& colls] |
2692 | 2687 | `(concat ~@(map #(core/list `lazy-seq %) colls))) |
2693 | 2688 |
|
2694 | | -(core/defmacro ^:private js-str [s] |
| 2689 | +(core/defmacro js-str [s] |
2695 | 2690 | (core/list 'js* "''+~{}" s)) |
2696 | 2691 |
|
2697 | | -(core/defmacro ^:private es6-iterable [ty] |
| 2692 | +(core/defmacro es6-iterable [ty] |
2698 | 2693 | `(aset (.-prototype ~ty) cljs.core/ITER_SYMBOL |
2699 | 2694 | (fn [] |
2700 | 2695 | (this-as this# |
|
2832 | 2827 | `(~'ns* ~(cons :refer-clojure args))) |
2833 | 2828 |
|
2834 | 2829 | ;; INTERNAL - do not use, only for Node.js |
2835 | | -(core/defmacro ^:private load-file* [f] |
| 2830 | +(core/defmacro load-file* [f] |
2836 | 2831 | `(. js/goog (~'nodeGlobalRequire ~f))) |
2837 | 2832 |
|
2838 | 2833 | (core/defmacro macroexpand-1 |
|
2901 | 2896 | (set! (. ~sym ~'-cljs$lang$applyTo) |
2902 | 2897 | ~(apply-to))))))) |
2903 | 2898 |
|
2904 | | -(core/defmacro ^:private copy-arguments [dest] |
| 2899 | +(core/defmacro copy-arguments [dest] |
2905 | 2900 | `(let [len# (alength (js-arguments))] |
2906 | 2901 | (loop [i# 0] |
2907 | 2902 | (when (< i# len#) |
|
0 commit comments