diff --git a/Clojure/Clojure.Source/clojure/core.clj b/Clojure/Clojure.Source/clojure/core.clj index 1b776733a..17655e331 100644 --- a/Clojure/Clojure.Source/clojure/core.clj +++ b/Clojure/Clojure.Source/clojure/core.clj @@ -3390,7 +3390,7 @@ (try (with-open ~(subvec bindings 2) ~@body) (finally - (. ~(bindings 0) Dispose)))) ;;; close => Dispose + (. ~(with-meta (bindings 0) {:tag 'IDisposable}) Dispose)))) ;;; close => Dispose Added the with-meta to provide the type hint for IDisposable :else (throw (ArgumentException. ;;;IllegalArgumentException. "with-open only allows Symbols in bindings")))) diff --git a/Clojure/Clojure/Bootstrap/version.properties b/Clojure/Clojure/Bootstrap/version.properties index ebbb8710c..16df7f58f 100644 --- a/Clojure/Clojure/Bootstrap/version.properties +++ b/Clojure/Clojure/Bootstrap/version.properties @@ -1 +1 @@ -version=1.4.0 \ No newline at end of file +version=1.4.1 \ No newline at end of file diff --git a/Clojure/Clojure/CljCompiler/GenProxy.cs b/Clojure/Clojure/CljCompiler/GenProxy.cs index 4eee9660c..e576467e1 100644 --- a/Clojure/Clojure/CljCompiler/GenProxy.cs +++ b/Clojure/Clojure/CljCompiler/GenProxy.cs @@ -215,6 +215,7 @@ private static void AddInterfaceMethods( MethodSignature sig = new MethodSignature(m); if (!considered.Contains(sig) && !m.IsPrivate + && !m.IsAssembly && !m.IsStatic && !m.IsFinal && !m.Name.Equals("Finalize")) diff --git a/Clojure/Clojure/Lib/RT.cs b/Clojure/Clojure/Lib/RT.cs index c825395e3..cb76cb3e7 100644 --- a/Clojure/Clojure/Lib/RT.cs +++ b/Clojure/Clojure/Lib/RT.cs @@ -1147,13 +1147,17 @@ static object NthFrom(object coll, int n, object notFound) return notFound; } - IList list = coll as IList; - if (list != null) // Changed to RandomAccess in Java Rev 1218. - { - if (n < list.Count) - return list[n]; - return notFound; - } + // Causes a problem with infinite LazySequences + // Four years after the fact, I now know why the change was made in Java Rev 1218. + // There is no RandomAccess equivalent in CLR. + // So we don't blow off IList's completely, I put this after the code that catches LazySeqs. + //IList list = coll as IList; + //if (list != null) // Changed to RandomAccess in Java Rev 1218. + //{ + // if (n < list.Count) + // return list[n]; + // return notFound; + //} JReMatcher jrem = coll as JReMatcher; if (jrem != null) @@ -1215,6 +1219,14 @@ static object NthFrom(object coll, int n, object notFound) return notFound; } + IList list = coll as IList; + if (list != null) // Changed to RandomAccess in Java Rev 1218. + { + if (n < list.Count) + return list[n]; + return notFound; + } + throw new InvalidOperationException("nth not supported on this type: " + Util.NameForType(coll.GetType())); } diff --git a/Clojure/Csharp.Tests/Csharp.Tests.csproj b/Clojure/Csharp.Tests/Csharp.Tests.csproj index 243a68a81..55c0436a8 100644 --- a/Clojure/Csharp.Tests/Csharp.Tests.csproj +++ b/Clojure/Csharp.Tests/Csharp.Tests.csproj @@ -43,7 +43,7 @@ ..\..\lib\DLR\4.0\Microsoft.Scripting.dll - + ..\..\lib\DLR\2.0\Microsoft.Scripting.Core.dll diff --git a/changes.md b/changes.md index 75f029f37..611fccd13 100644 --- a/changes.md +++ b/changes.md @@ -1,6 +1,6 @@  -# Changes to Clojure in Version 1.4 +# Changes to Clojure in Version 1.4.1 ## CONTENTS @@ -29,6 +29,7 @@ 2.19 Java int is boxed as java.lang.Integer 3 Performance Enhancements 4 Bug Fixes + 5 Big Fixes in 1.4.1 ## 1 Deprecated and Removed Features @@ -342,4 +343,15 @@ for more information. Fix printf handling of tz for DateTimeOffsets * CLJCLR-??? Fix infinite recursion on generic type lookup when type name is bad - \ No newline at end of file + +## 4 Bug Fixes + +* CLJCLR-??? + Fix RT.nth problem with LazySeq +* CLJCLR-??? + Fix with-open to include type hint for IDisposable before Dispose call +* CLJCLR-??? + Fix clojure.repl proxy of PushbackTextREader problem under 4.5 + + +