22
33# Changes to Clojure in Version 1.7
44
5- ## 1 New and Improved Features
5+ ## 1 Compatibility Notes
66
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
849
950Transducers is a new way to decouple algorithmic transformations from their
1051application in different contexts. Transducers are functions that transform
@@ -72,7 +113,7 @@ Some related issues addressed during development:
72113* [ CLJ-1669] ( http://dev.clojure.org/jira/browse/CLJ-1669 )
73114* [ CLJ-1723] ( http://dev.clojure.org/jira/browse/CLJ-1723 )
74115
75- ### 1 .2 Reader Conditionals
116+ ### 2 .2 Reader Conditionals
76117
77118Reader Conditionals are a new capability to support portable code that
78119can run on multiple Clojure platforms with only small changes. In
@@ -132,7 +173,7 @@ http://dev.clojure.org/display/design/Reader+Conditionals
132173* [ CLJ-1728] ( http://dev.clojure.org/jira/browse/CLJ-1728 )
133174* [ CLJ-1706] ( http://dev.clojure.org/jira/browse/CLJ-1706 )
134175
135- ### 1 .3 Keyword and Symbol Construction
176+ ### 2 .3 Keyword and Symbol Construction
136177
137178In response to issues raised in [ CLJ-1439] ( http://dev.clojure.org/jira/browse/CLJ-1439 ) ,
138179several changes have been made in symbol and keyword construction:
@@ -144,7 +185,7 @@ in a performance increase.
1441852 ) Keywords are cached and keyword construction includes a cache check. A change was made
145186to only clear the cache reference queue when there is a cache miss.
146187
147- ### 1 .4 Warn on Boxed Math
188+ ### 2 .4 Warn on Boxed Math
148189
149190One source of performance issues is the (unintended) use of arithmetic operations on
150191boxed numbers. To make detecting the presence of boxed math easier, a warning will now
@@ -168,7 +209,7 @@ Example use:
168209* [ CLJ-1535] ( http://dev.clojure.org/jira/browse/CLJ-1535 )
169210* [ CLJ-1642] ( http://dev.clojure.org/jira/browse/CLJ-1642 )
170211
171- ### 1 .5 update - like update-in for first level
212+ ### 2 .5 update - like update-in for first level
172213
173214` update ` is a new function that is like update-in specifically for first-level keys:
174215
@@ -185,7 +226,7 @@ Example use:
185226
186227* [ CLJ-1251] ( http://dev.clojure.org/jira/browse/CLJ-1251 )
187228
188- ### 1 .6 Faster reduce and iterator paths
229+ ### 2 .6 Faster reduce and iterator paths
189230
190231Several important Clojure functions now return sequences that also
191232contain fast reduce() (or in some cases iterator()) paths. In many
@@ -222,7 +263,7 @@ eduction.
222263* [ CLJ-1726] ( http://dev.clojure.org/jira/browse/CLJ-1726 )
223264* [ CLJ-1727] ( http://dev.clojure.org/jira/browse/CLJ-1727 )
224265
225- ### 1 .7 Printing as data
266+ ### 2 .7 Printing as data
226267
227268There have been enhancements in how the REPL prints values without a
228269print-method, specifically Throwable and the fallthrough Object case.
@@ -259,26 +300,24 @@ map data: `Throwable->map`.
259300* [ CLJ-1716] ( http://dev.clojure.org/jira/browse/CLJ-1716 )
260301* [ CLJ-1735] ( http://dev.clojure.org/jira/browse/CLJ-1735 )
261302
262- ### 1 .8 run!
303+ ### 2 .8 run!
263304
264305run! is a new function that takes a side effect reducing function and runs
265306it for all items in a collection via reduce. The accumulator is ignored and
266307nil is returned.
267308
268309 (run! println (range 10))
269310
270- ## 2 Enhancements
311+ ## 3 Enhancements
271312
272- ### 2 .1 Error messages
313+ ### 3 .1 Error messages
273314
274315* [ CLJ-1261] ( http://dev.clojure.org/jira/browse/CLJ-1261 )
275316 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
278317* [ CLJ-1297] ( http://dev.clojure.org/jira/browse/CLJ-1297 )
279318 Give more specific hint if namespace with "-" not found to check file uses "_ "
280319
281- ### 2 .2 Documentation strings
320+ ### 3 .2 Documentation strings
282321
283322* [ CLJ-1417] ( http://dev.clojure.org/jira/browse/CLJ-1417 )
284323 clojure.java.io/input-stream has incorrect docstring
@@ -292,8 +331,10 @@ nil is returned.
292331 Fix typo in deftype docstring
293332* [ CLJ-1478] ( http://dev.clojure.org/jira/browse/CLJ-1378 )
294333 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
295336
296- ### 2 .3 Performance
337+ ### 3 .3 Performance
297338
298339* [ CLJ-1430] ( http://dev.clojure.org/jira/browse/CLJ-1430 )
299340 Improve performance of partial with more unrolling
@@ -310,7 +351,7 @@ nil is returned.
310351* [ CLJ-1695] ( http://dev.clojure.org/jira/browse/CLJ-1695 )
311352 Fixed reflection call in variadic vector-of constructor
312353
313- ### 2 .4 Other enhancements
354+ ### 3 .4 Other enhancements
314355
315356* [ CLJ-1191] ( http://dev.clojure.org/jira/browse/CLJ-1191 )
316357 Improve apropos to show some indication of namespace of symbols found
@@ -341,7 +382,7 @@ nil is returned.
341382* [ CLJ-1683] ( http://dev.clojure.org/jira/browse/CLJ-1683 )
342383 Change reduce tests to better catch reduce without init bugs
343384
344- ## 3 Bug Fixes
385+ ## 4 Bug Fixes
345386
346387* [ CLJ-1362] ( http://dev.clojure.org/jira/browse/CLJ-1362 )
347388 Reduce broken on some primitive vectors
@@ -399,6 +440,8 @@ nil is returned.
399440 Use equals() instead of == when resolving Symbol
400441* [ CLJ-1195] ( http://dev.clojure.org/jira/browse/CLJ-1195 )
401442 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
402445
403446# Changes to Clojure in Version 1.6
404447
0 commit comments