2
2
3
3
# Changes to Clojure in Version 1.7
4
4
5
- ## 1 New and Improved Features
5
+ ## 1 Compatibility Notes
6
6
7
- ### 1.1 Transducers
7
+ Please be aware of the following issues when upgrading to Clojure 1.7.
8
+
9
+ ### Seqs on Java iterators that return the same mutating object
10
+
11
+ Seqs are fundamentally incompatible with Java iterators that return
12
+ the same mutating object on every call to next(). Some Clojure
13
+ libraries incorrectly rely on calling seq on such iterators.
14
+
15
+ In 1.7, iterator-seqs are chunked, which will cause many of these
16
+ incorrect usages to return incorrect results immediately.
17
+
18
+ The ` seq ` and ` iterator-seq ` docstrings have been updated to include
19
+ an explicit warning. Libraries that incorrectly use ` seq ` and
20
+ ` iterator-seq ` will need to be fixed before running against 1.7.
21
+
22
+ * [ CLJ-1669] ( http://dev.clojure.org/jira/browse/CLJ-1669 )
23
+ * [ CLJ-1738] ( http://dev.clojure.org/jira/browse/CLJ-1738 )
24
+
25
+ ### Thread owner check removed on transients
26
+
27
+ Prior to Clojure 1.7, transients would allow modification only from the
28
+ thread that created the transient. This check has been removed. It is
29
+ still a requirement that transients should be updated by only a single
30
+ thread at a time.
31
+
32
+ This constraint was relaxed to allow transients to be used in cases where
33
+ code is multiplexed across multiple threads in a pool (such as go blocks
34
+ in core.async).
35
+
36
+ ### keys/vals require custom map type to implement Iterable
37
+
38
+ Invoking ` keys ` or ` vals ` on a custom map type that implements IPersistentMap
39
+ will now use the Iterable iterator() method instead of accessing entries
40
+ via the seq of the map. There have been no changes in the type hierarchy
41
+ (IPersistentMap has always extended Iterable) but former map-like instances
42
+ may have skipped implementing this method in the past.
43
+
44
+ * [ CLJ-1602] ( http://dev.clojure.org/jira/browse/CLJ-1602 )
45
+
46
+ ## 2 New and Improved Features
47
+
48
+ ### 2.1 Transducers
8
49
9
50
Transducers is a new way to decouple algorithmic transformations from their
10
51
application in different contexts. Transducers are functions that transform
@@ -72,7 +113,7 @@ Some related issues addressed during development:
72
113
* [ CLJ-1669] ( http://dev.clojure.org/jira/browse/CLJ-1669 )
73
114
* [ CLJ-1723] ( http://dev.clojure.org/jira/browse/CLJ-1723 )
74
115
75
- ### 1 .2 Reader Conditionals
116
+ ### 2 .2 Reader Conditionals
76
117
77
118
Reader Conditionals are a new capability to support portable code that
78
119
can run on multiple Clojure platforms with only small changes. In
@@ -132,7 +173,7 @@ http://dev.clojure.org/display/design/Reader+Conditionals
132
173
* [ CLJ-1728] ( http://dev.clojure.org/jira/browse/CLJ-1728 )
133
174
* [ CLJ-1706] ( http://dev.clojure.org/jira/browse/CLJ-1706 )
134
175
135
- ### 1 .3 Keyword and Symbol Construction
176
+ ### 2 .3 Keyword and Symbol Construction
136
177
137
178
In response to issues raised in [ CLJ-1439] ( http://dev.clojure.org/jira/browse/CLJ-1439 ) ,
138
179
several changes have been made in symbol and keyword construction:
@@ -144,7 +185,7 @@ in a performance increase.
144
185
2 ) Keywords are cached and keyword construction includes a cache check. A change was made
145
186
to only clear the cache reference queue when there is a cache miss.
146
187
147
- ### 1 .4 Warn on Boxed Math
188
+ ### 2 .4 Warn on Boxed Math
148
189
149
190
One source of performance issues is the (unintended) use of arithmetic operations on
150
191
boxed numbers. To make detecting the presence of boxed math easier, a warning will now
@@ -168,7 +209,7 @@ Example use:
168
209
* [ CLJ-1535] ( http://dev.clojure.org/jira/browse/CLJ-1535 )
169
210
* [ CLJ-1642] ( http://dev.clojure.org/jira/browse/CLJ-1642 )
170
211
171
- ### 1 .5 update - like update-in for first level
212
+ ### 2 .5 update - like update-in for first level
172
213
173
214
` update ` is a new function that is like update-in specifically for first-level keys:
174
215
@@ -185,7 +226,7 @@ Example use:
185
226
186
227
* [ CLJ-1251] ( http://dev.clojure.org/jira/browse/CLJ-1251 )
187
228
188
- ### 1 .6 Faster reduce and iterator paths
229
+ ### 2 .6 Faster reduce and iterator paths
189
230
190
231
Several important Clojure functions now return sequences that also
191
232
contain fast reduce() (or in some cases iterator()) paths. In many
@@ -222,7 +263,7 @@ eduction.
222
263
* [ CLJ-1726] ( http://dev.clojure.org/jira/browse/CLJ-1726 )
223
264
* [ CLJ-1727] ( http://dev.clojure.org/jira/browse/CLJ-1727 )
224
265
225
- ### 1 .7 Printing as data
266
+ ### 2 .7 Printing as data
226
267
227
268
There have been enhancements in how the REPL prints values without a
228
269
print-method, specifically Throwable and the fallthrough Object case.
@@ -259,26 +300,24 @@ map data: `Throwable->map`.
259
300
* [ CLJ-1716] ( http://dev.clojure.org/jira/browse/CLJ-1716 )
260
301
* [ CLJ-1735] ( http://dev.clojure.org/jira/browse/CLJ-1735 )
261
302
262
- ### 1 .8 run!
303
+ ### 2 .8 run!
263
304
264
305
run! is a new function that takes a side effect reducing function and runs
265
306
it for all items in a collection via reduce. The accumulator is ignored and
266
307
nil is returned.
267
308
268
309
(run! println (range 10))
269
310
270
- ## 2 Enhancements
311
+ ## 3 Enhancements
271
312
272
- ### 2 .1 Error messages
313
+ ### 3 .1 Error messages
273
314
274
315
* [ CLJ-1261] ( http://dev.clojure.org/jira/browse/CLJ-1261 )
275
316
Invalid defrecord results in exception attributed to consuming ns instead of defrecord ns
276
- * [ CLJ-1169] ( http://dev.clojure.org/jira/browse/CLJ-1169 )
277
- Report line,column, and source in defmacro errors
278
317
* [ CLJ-1297] ( http://dev.clojure.org/jira/browse/CLJ-1297 )
279
318
Give more specific hint if namespace with "-" not found to check file uses "_ "
280
319
281
- ### 2 .2 Documentation strings
320
+ ### 3 .2 Documentation strings
282
321
283
322
* [ CLJ-1417] ( http://dev.clojure.org/jira/browse/CLJ-1417 )
284
323
clojure.java.io/input-stream has incorrect docstring
@@ -292,8 +331,10 @@ nil is returned.
292
331
Fix typo in deftype docstring
293
332
* [ CLJ-1478] ( http://dev.clojure.org/jira/browse/CLJ-1378 )
294
333
Fix typo in clojure.main usage
334
+ * [ CLJ-1738] ( http://dev.clojure.org/jira/browse/CLJ-1738 )
335
+ Clarify usage on Java iterators in seq and iterator-seq
295
336
296
- ### 2 .3 Performance
337
+ ### 3 .3 Performance
297
338
298
339
* [ CLJ-1430] ( http://dev.clojure.org/jira/browse/CLJ-1430 )
299
340
Improve performance of partial with more unrolling
@@ -310,7 +351,7 @@ nil is returned.
310
351
* [ CLJ-1695] ( http://dev.clojure.org/jira/browse/CLJ-1695 )
311
352
Fixed reflection call in variadic vector-of constructor
312
353
313
- ### 2 .4 Other enhancements
354
+ ### 3 .4 Other enhancements
314
355
315
356
* [ CLJ-1191] ( http://dev.clojure.org/jira/browse/CLJ-1191 )
316
357
Improve apropos to show some indication of namespace of symbols found
@@ -341,7 +382,7 @@ nil is returned.
341
382
* [ CLJ-1683] ( http://dev.clojure.org/jira/browse/CLJ-1683 )
342
383
Change reduce tests to better catch reduce without init bugs
343
384
344
- ## 3 Bug Fixes
385
+ ## 4 Bug Fixes
345
386
346
387
* [ CLJ-1362] ( http://dev.clojure.org/jira/browse/CLJ-1362 )
347
388
Reduce broken on some primitive vectors
@@ -399,6 +440,8 @@ nil is returned.
399
440
Use equals() instead of == when resolving Symbol
400
441
* [ CLJ-1195] ( http://dev.clojure.org/jira/browse/CLJ-1195 )
401
442
emit-hinted-impl expands to ns-qualified invocation of fn
443
+ * [ CLJ-1237] ( http://dev.clojure.org/jira/browse/CLJ-1237 )
444
+ reduce of sequence that switches between chunked and unchunked many times throws StackOverflow
402
445
403
446
# Changes to Clojure in Version 1.6
404
447
0 commit comments