File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -774,6 +774,8 @@ Some common, idiomatic aliases are shown below:
774
774
| Namespace | Idiomatic Alias
775
775
| clojure.java.io
776
776
| io
777
+ | clojure.math
778
+ | math
777
779
| clojure.set
778
780
| set
779
781
| clojure.string
@@ -2137,6 +2139,21 @@ Try to use `swap!` rather than `reset!`, where possible.
2137
2139
(reset! a 5)
2138
2140
----
2139
2141
2142
+ == Math
2143
+
2144
+ === Prefer `clojure.math` Functions Over Interop [[prefer-clojure-math-over-interop]]
2145
+
2146
+ Prefer math functions from `clojure.math` over (Java) interop or rolling your own.
2147
+
2148
+ [source,clojure]
2149
+ ----
2150
+ ;; good
2151
+ (clojure.math/pow 2 5)
2152
+
2153
+ ;; okish
2154
+ (Math/pow 2 5)
2155
+ ----
2156
+
2140
2157
== Strings
2141
2158
2142
2159
=== Prefer `clojure.string` Functions Over Interop [[prefer-clojure-string-over-interop]]
You can’t perform that action at this time.
0 commit comments