@@ -51,7 +51,7 @@ transducers in different ways:
5151
5252* sequence - takes a transformation and a coll and produces a lazy seq
5353* transduce - reduce with a transformation (eager)
54- * eduction - returns a reducible/seqable/ iterable seq of applications of the transducer to items in coll. Applications are re-performed with every reduce/seq /iterator.
54+ * eduction - returns a reducible/iterable of applications of the transducer to items in coll. Applications are re-performed with every reduce/iterator.
5555* run! - run the transformation for side effects on the collection
5656
5757There have been a number of internal changes to support transducers:
@@ -69,8 +69,64 @@ Some related issues addressed during development:
6969* [ CLJ-1606] ( http://dev.clojure.org/jira/browse/CLJ-1606 )
7070* [ CLJ-1621] ( http://dev.clojure.org/jira/browse/CLJ-1621 )
7171* [ CLJ-1600] ( http://dev.clojure.org/jira/browse/CLJ-1600 )
72+ * [ CLJ-1635] ( http://dev.clojure.org/jira/browse/CLJ-1635 )
73+ * [ CLJ-1683] ( http://dev.clojure.org/jira/browse/CLJ-1683 )
74+ * [ CLJ-1669] ( http://dev.clojure.org/jira/browse/CLJ-1669 )
7275
73- ### 1.2 Keyword and Symbol Construction
76+ ### 1.2 Reader Conditionals
77+
78+ Reader Conditionals is a new capability to support portable code that
79+ can run on multiple Clojure platforms with only small changes. In
80+ particular, this feature aims to support the increasingly common case
81+ of libraries targeting both Clojure and ClojureScript.
82+
83+ Code intended to be common across multiple platforms should use a new
84+ supported file extension: ".cljc". When requested to load a namespace,
85+ the platform-specific file extension (.clj, .cljs) will be checked
86+ prior to .cljc.
87+
88+ A new reader form can be used to specify "reader conditional" code in
89+ cljc files (and * only* cljc files). Each platform defines a feature
90+ identifying the platform (: clj , : cljs , : cljr ). The reader conditional
91+ specifies code that is read conditionally based on the feature/
92+
93+ Form #? takes a list of alternating feature and expression. These are
94+ checked like cond and the selected expression is read and returned. Other
95+ branches are unread. If no branch is selected, the reader reads nothing
96+ (not nil, but literally as if reading ""). An optional ": default " branch
97+ can be used as a fallthrough.
98+
99+ Reader conditional with 2 features and a default:
100+
101+ #?(:clj Double/NaN
102+ :cljs js/NaN
103+ :default nil)
104+
105+ There is also a reader conditional splicing form. The evaluated expression
106+ should be sequential and will be spliced into the surrounded code, similar
107+ to unqoute-splicing.
108+
109+ For example:
110+
111+ [ 1 2 #?@(: clj [ 3 4] : cljs [ 5 6] )]
112+
113+ This form would read as [ 1 2 3 4] on Clojure, [ 1 2 5 6] on ClojureScript,
114+ and [ 1 2] on any other platform.
115+
116+ Additionally, the reader can now be invoked with options for the features
117+ to use and how to interpret reader conditionals. By default, reader conditionals
118+ are not allowed, but that can be turned on, or a "preserve" mode can be used to
119+ preserve all branches (most likely useful for tooling or source transforms).
120+
121+ In the preserve mode, the reader conditional itself and any tagged literals
122+ within the unselected branches are returned as tagged literal data.
123+
124+ For more information, see:
125+ http://dev.clojure.org/display/design/Reader+Conditionals
126+
127+ * [ CLJ-1424] ( http://dev.clojure.org/jira/browse/CLJ-1424 )
128+
129+ ### 1.3 Keyword and Symbol Construction
74130
75131In response to issues raised in [ CLJ-1439] ( http://dev.clojure.org/jira/browse/CLJ-1439 ) ,
76132several changes have been made in symbol and keyword construction:
@@ -82,7 +138,7 @@ in a performance increase.
821382 ) Keywords are cached and keyword construction includes a cache check. A change was made
83139to only clear the cache reference queue when there is a cache miss.
84140
85- ### 1.3 Warn on Boxed Math
141+ ### 1.4 Warn on Boxed Math
86142
87143One source of performance issues is the (unintended) use of arithmetic operations on
88144boxed numbers. To make detecting the presence of boxed math easier, a warning will now
@@ -104,8 +160,9 @@ Example use:
104160
105161* [ CLJ-1325] ( http://dev.clojure.org/jira/browse/CLJ-1325 )
106162* [ CLJ-1535] ( http://dev.clojure.org/jira/browse/CLJ-1535 )
163+ * [ CLJ-1642] ( http://dev.clojure.org/jira/browse/CLJ-1642 )
107164
108- ### 1.4 update - like update-in for first level
165+ ### 1.5 update - like update-in for first level
109166
110167` update ` is a new function that is like update-in specifically for first-level keys:
111168
@@ -122,6 +179,65 @@ Example use:
122179
123180* [ CLJ-1251] ( http://dev.clojure.org/jira/browse/CLJ-1251 )
124181
182+ ### 1.6 Faster reduce and iterator paths
183+
184+ Several important Clojure functions now return sequences that also
185+ contain fast reduce() (or in some cases iterator()) paths. In many
186+ cases, the new implementations are also faster for lazy sequences
187+
188+ * repeat - now implements IReduce
189+ * cycle - implements IReduceInit
190+ * iterate - implements IReduceInit
191+ * range - implements IReduce, specialized case handles common case of all longs
192+ * keys - iterates directly over the keys of a map, without seq or MapEntry allocation
193+ * vals - iterates directly over the vals of a map, without seq or MapEntry allocation
194+ * iterator-seq - creates a chunked sequence when previously it was unchunked
195+
196+ Additionally, hash-maps and hash-sets now provide iterators that walk
197+ the data structure directly rather than via a sequence.
198+
199+ A new interface (IMapIterable) for direct key and val iterators on maps
200+ was added. External data structures can use this interface to provide
201+ direct key and val iterators via keys and vals.
202+
203+ These enhancements are particularly effective when used
204+ in tandem with transducers via transduce, sequence, into, and
205+ eduction.
206+
207+ * [ CLJ-1603] ( http://dev.clojure.org/jira/browse/CLJ-1603 )
208+ * [ CLJ-1515] ( http://dev.clojure.org/jira/browse/CLJ-1515 )
209+ * [ CLJ-1602] ( http://dev.clojure.org/jira/browse/CLJ-1602 )
210+ * [ CLJ-1669] ( http://dev.clojure.org/jira/browse/CLJ-1669 )
211+
212+ ### 1.7 Printing as data
213+
214+ There have been enhancements in how the REPL prints values without a
215+ print-method, specifically Throwable and the fallthrough Object case.
216+ Both cases now print in a tagged literal data form that can be read
217+ by the reader.
218+
219+ Unhandled objects print with the class, hash code, and toString:
220+
221+ user=> *ns*
222+ #object[clojure.lang.Namespace 0x55aa628 "user"]
223+
224+ Thrown exceptions will still be printed in the normal way by the default
225+ REPL but printing them to a stream will show a different form:
226+
227+ user=> (/ 1 0)
228+ ArithmeticException Divide by zero clojure.lang.Numbers.divide (Numbers.java:158)
229+ user=> (println *e)
230+ #error{:cause Divide by zero,
231+ :via [{:type java.lang.ArithmeticException,
232+ :message Divide by zero,
233+ :at [clojure.lang.Numbers divide Numbers.java 158]}],
234+ :trace
235+ [[clojure.lang.Numbers divide Numbers.java 158]
236+ [clojure.lang.Numbers divide Numbers.java 3808]
237+ [user$eval5 invoke NO_SOURCE_FILE 3]
238+ ;; elided ...
239+ ]]}
240+
125241## 2 Enhancements
126242
127243### 2.1 Error messages
@@ -185,6 +301,14 @@ Example use:
185301 set now works with things that only implement Iterable or IReduceInit
186302* [ CLJ-1633] ( http://dev.clojure.org/jira/browse/CLJ-1633 )
187303 PersistentList/creator doesn't handle ArraySeqs correctly
304+ * [ CLJ-1589] ( http://dev.clojure.org/jira/browse/CLJ-1589 )
305+ Clean up unused paths in InternalReduce
306+ * [ CLJ-1677] ( http://dev.clojure.org/jira/browse/CLJ-1677 )
307+ Add setLineNumber() to LineNumberingPushbackReader
308+ * [ CLJ-1667] ( http://dev.clojure.org/jira/browse/CLJ-1667 )
309+ Change test to avoid using hard-coded socket port
310+ * [ CLJ-1683] ( http://dev.clojure.org/jira/browse/CLJ-1683 )
311+ Change reduce tests to better catch reduce without init bugs
188312
189313## 3 Bug Fixes
190314
@@ -224,8 +348,23 @@ Example use:
224348 Some IReduce/IReduceInit implementors don't respect reduced
225349* [ CLJ-979] ( http://dev.clojure.org/jira/browse/CLJ-979 )
226350 Clojure resolves to wrong deftype classes when AOT compiling or reloading
227- * [ CLJ-1544] ( http://dev.clojure.org/jira/browse/CLJ-1544 )
228- AOT bug involving namespaces loaded before AOT compilation started
351+ * [ CLJ-1636] ( http://dev.clojure.org/jira/browse/CLJ-1636 )
352+ Fix intermittent SeqIterator problem by removing use of this as a sentinel
353+ * [ CLJ-1637] ( http://dev.clojure.org/jira/browse/CLJ-1636 )
354+ Fix regression from CLJ-1546 that broke vec on MapEntry
355+ * [ CLJ-1663] ( http://dev.clojure.org/jira/browse/CLJ-1663 )
356+ Fix regression from CLJ-979 for DynamicClassLoader classloader delegation
357+ * [ CLJ-1604] ( http://dev.clojure.org/jira/browse/CLJ-1604 )
358+ Fix error from AOT'ed code defining a var with a clojure.core symbol name
359+ * [ CLJ-1561] ( http://dev.clojure.org/jira/browse/CLJ-1561 )
360+ Fix incorrect line number reporting for error locations
361+ * [ CLJ-1568] ( http://dev.clojure.org/jira/browse/CLJ-1568 )
362+ Fix incorrect line number reporting for error locations
363+ * [ CLJ-1638] ( http://dev.clojure.org/jira/browse/CLJ-1638 )
364+ Fix regression from CLJ-1546 removed PersistentVector.create(List) method
365+ * [ CLJ-1681] ( http://dev.clojure.org/jira/browse/CLJ-1681 )
366+ Fix regression from CLJ-1248 (1.6) in reflection warning with literal nil argument
367+
229368
230369# Changes to Clojure in Version 1.6
231370
0 commit comments