|
1 | 1 | <!-- -*- mode: markdown ; mode: visual-line ; coding: utf-8 -*- -->
|
2 | 2 |
|
| 3 | +# Changes to Clojure in Version 1.6 |
| 4 | + |
| 5 | +## CONTENTS |
| 6 | + |
| 7 | +## 1 Deprecated and Removed Features |
| 8 | + |
| 9 | +None. |
| 10 | + |
| 11 | +## 2 New and Improved Features |
| 12 | + |
| 13 | +### 2.1 Java API |
| 14 | + |
| 15 | +The clojure.api package provides a minimal interface to bootstrap Clojure access from other JVM languages. It does this by providing: |
| 16 | +1. The ability to use Clojure's namespaces to locate an arbitrary var, returning the var's clojure.lang.IFn interface. |
| 17 | +2. A convenience method read for reading data using Clojure's edn reader |
| 18 | + |
| 19 | +IFns provide complete access to Clojure's APIs. You can also access any other library written in Clojure, after adding either its source or compiled form to the classpath. |
| 20 | + |
| 21 | +The public Java API for Clojure consists of the following classes and interfaces: |
| 22 | +* clojure.api.API |
| 23 | +* clojure.lang.IFn |
| 24 | + |
| 25 | +All other Java classes should be treated as implementation details, and applications should avoid relying on them. |
| 26 | + |
| 27 | +To lookup and call a Clojure function: |
| 28 | + |
| 29 | + IFn plus = API.var("clojure.core", "+"); |
| 30 | + plus.invoke(1, 2); |
| 31 | + |
| 32 | +Functions in clojure.core are automatically loaded. Other namespaces can be loaded via require: |
| 33 | + |
| 34 | + IFn require = API.var("clojure.core", "require"); |
| 35 | + require.invoke(API.read("clojure.set")); |
| 36 | + |
| 37 | +IFns can be passed to higher order functions, e.g. the example below passes plus to read: |
| 38 | + |
| 39 | + IFn map = API.var("clojure.core", "map"); |
| 40 | + IFn inc = API.var("clojure.core", "inc"); |
| 41 | + map.invoke(inc, API.read("[1 2 3]")); |
| 42 | + |
| 43 | +Most IFns in Clojure refer to functions. A few, however, refer to non-function data values. To access these, use deref instead of fn: |
| 44 | + |
| 45 | + IFn printLength = API.var("clojure.core", "*print-length*"); |
| 46 | + API.var("clojure.core", "deref").invoke(printLength); |
| 47 | + |
| 48 | +### 2.2 JDK and Dependency Version Updates |
| 49 | + |
| 50 | +Clojure now builds with Java SE 1.6 and emits bytecode requiring Java SE 1.6 instead of Java SE 1.5. [CLJ-1268] |
| 51 | + |
| 52 | +### 2.3 Printing |
| 53 | + |
| 54 | +* [CLJ-908](http://dev.clojure.org/jira/browse/CLJ-908) |
| 55 | + Print metadata for functions when *print-meta* is true and remove errant space at beginning. |
| 56 | +* [CLJ-937](http://dev.clojure.org/jira/browse/CLJ-937) |
| 57 | + pprint cl-format now supports E, F, and G formats for ratios. |
| 58 | + |
| 59 | +### 2.4 Other improvements |
| 60 | + |
| 61 | +* [CLJ-908](http://dev.clojure.org/jira/browse/CLJ-908) |
| 62 | + Make *default-data-reader-fn* set!-able in REPL, similar to *data-readers*. |
| 63 | +* [CLJ-783](http://dev.clojure.org/jira/browse/CLJ-783) |
| 64 | + Make clojure.inspector/inspect-tree work on sets. |
| 65 | +* [CLJ-896](http://dev.clojure.org/jira/browse/CLJ-896) |
| 66 | + Make browse-url aware of xdg-open. |
| 67 | +* [CLJ-1160](http://dev.clojure.org/jira/browse/CLJ-1160) |
| 68 | + Fix clojure.core.reducers/mapcat does not stop on reduced? values. |
| 69 | +* [CLJ-1121](http://dev.clojure.org/jira/browse/CLJ-1121) |
| 70 | + -> and ->> have been rewritten to work with a broader set of macros. |
| 71 | + |
| 72 | +## 3 Improved error messages |
| 73 | + |
| 74 | +* [CLJ-1099](http://dev.clojure.org/jira/browse/CLJ-1099) |
| 75 | + If non-seq passed where seq is needed, error message now is an ExceptionInfo with the instance value, retrievable via ex-data. |
| 76 | +* [CLJ-1083](http://dev.clojure.org/jira/browse/CLJ-1083) |
| 77 | + Fix error message reporting for "munged" function names (like a->b). |
| 78 | +* [CLJ-1056](http://dev.clojure.org/jira/browse/CLJ-1056) |
| 79 | + Handle more cases and improve error message for errors in defprotocol definnitions. |
| 80 | +* [CLJ-1102](http://dev.clojure.org/jira/browse/CLJ-1102) |
| 81 | + Better handling of exceptions with empty stack traces. |
| 82 | + |
| 83 | +## 4 Improved documentation strings |
| 84 | + |
| 85 | +* [CLJ-1164](http://dev.clojure.org/jira/browse/CLJ-1164) |
| 86 | + Fix typos in clojure.instant/validated and other internal instant functions. |
| 87 | +* [CLJ-1143](http://dev.clojure.org/jira/browse/CLJ-1143) |
| 88 | + Correct doc string for ns macro. |
| 89 | +* [CLJ-196](http://dev.clojure.org/jira/browse/CLJ-196) |
| 90 | + Clarify value of *file* is undefined in the REPL. |
| 91 | +* [CLJ-1228](http://dev.clojure.org/jira/browse/CLJ-1228) |
| 92 | + Fix a number of spelling errors in namespace and doc strings. |
| 93 | +* [CLJ-835](http://dev.clojure.org/jira/browse/CLJ-835) |
| 94 | + Update defmulti doc to clarify expectations for hierarchy argument. |
| 95 | + |
| 96 | +## 5 Bug Fixes |
| 97 | + |
| 98 | +* [CLJ-1018](http://dev.clojure.org/jira/browse/CLJ-1018) |
| 99 | + Make range consistently return () with a step of 0. |
| 100 | +* [CLJ-863](http://dev.clojure.org/jira/browse/CLJ-863) |
| 101 | + Make interleave return () on 0 args and identity on 1 args. |
| 102 | +* [CLJ-1072](http://dev.clojure.org/jira/browse/CLJ-1072) |
| 103 | + Update internal usages of the old metadata reader syntax to new syntax. |
| 104 | +* [CLJ-1193](http://dev.clojure.org/jira/browse/CLJ-1193) |
| 105 | + Make bigint and biginteger functions work on double values outside long range. |
| 106 | +* [CLJ-1154](http://dev.clojure.org/jira/browse/CLJ-1154) |
| 107 | + Make Compile.java flush but not close stdout so errors can be reported. |
| 108 | +* [CLJ-1161](http://dev.clojure.org/jira/browse/CLJ-1161) |
| 109 | + Remove bad version.properties from sources jar. |
| 110 | +* [CLJ-1175](http://dev.clojure.org/jira/browse/CLJ-1175) |
| 111 | + Fix invalid behavior of Delay/deref if an exception is thrown - exception will now be rethrown on subsequent calls and not enter a corrupted state. |
| 112 | +* [CLJ-1171](http://dev.clojure.org/jira/browse/CLJ-1171) |
| 113 | + Fix several issues with instance? to make it consistent when used with apply. |
| 114 | +* [CLJ-1202](http://dev.clojure.org/jira/browse/CLJ-1202) |
| 115 | + Protocol fns with dashes may get incorrectly compiled into field accesses. |
| 116 | +* [CLJ-850](http://dev.clojure.org/jira/browse/CLJ-850) |
| 117 | + Add check to emit invokePrim with return type of double or long if type-hinted. |
| 118 | +* [CLJ-1177](http://dev.clojure.org/jira/browse/CLJ-1177) |
| 119 | + clojure.java.io URL to File coercion corrupts path containing UTF-8 characters. |
| 120 | +* [CLJ-1234](http://dev.clojure.org/jira/browse/CLJ-1234) |
| 121 | + Accept whitespace in Record and Type reader forms (similar to data literals). |
| 122 | +* [CLJ-1233](http://dev.clojure.org/jira/browse/CLJ-1233) |
| 123 | + Allow ** as a valid symbol name without triggering dynamic warnings. |
| 124 | +* [CLJ-1246](http://dev.clojure.org/jira/browse/CLJ-1246) |
| 125 | + Add support to clojure.reflect for classes with annotations. |
| 126 | + * [CLJ-1184](http://dev.clojure.org/jira/browse/CLJ-1184) |
| 127 | + Evaling #{do ...} or [do ...] is treated as do special form. |
| 128 | +* [CLJ-1125](http://dev.clojure.org/jira/browse/CLJ-1125) |
| 129 | + Clojure can leak memory in a servlet container when using dynamic bindings or STM transactions. |
| 130 | +* [CLJ-1090](http://dev.clojure.org/jira/browse/CLJ-1090) |
| 131 | + Indirect function calls through Var instances fail to clear locals. |
| 132 | +* [CLJ-1076](http://dev.clojure.org/jira/browse/CLJ-1076) |
| 133 | + pprint tests fail on Windows, expecting \n. |
| 134 | +* [CLJ-766](http://dev.clojure.org/jira/browse/CLJ-766) |
| 135 | + Make into-array work consistently with short-array and byte-array on bigger types. |
| 136 | +* [CLJ-1285](http://dev.clojure.org/jira/browse/CLJ-1285) |
| 137 | + Data structure invariants are violated after persistent operations when collision node created by transients. |
| 138 | + |
| 139 | + |
| 140 | +## 6 Compatibility Notes |
| 141 | + |
| 142 | +None. |
| 143 | + |
3 | 144 | # Changes to Clojure in Version 1.5.1
|
4 | 145 |
|
5 | 146 | * fix for leak caused by ddc65a96fdb1163b
|
|
0 commit comments