On Feb 20, 2:18 pm, Jason Wolfe wrote:
> Hmmm, that is weird ... I would expect the sort to throw an exception,
> but it seems to complete happily. (If you try it with a vector
> instead of a list, it will error).
>
Fixed in svn 1298 - thanks for the report.
Rich
--~--~-~--~~---
On Fri, Feb 20, 2009 at 1:59 PM, Steffen Glückselig wrote:
>
> I was trying to use Clojure to verify the behavior some method in
> Java.
>
> Namely I wanted to quickly check whether Collections.sort does the
> sorting I need.
>
> So I came up with:
>
> (let [list '("1" "KB" "K6" "2" "EÜ" "EZ" "ES
The Clojure collections are immutable, which is their entire reason for
existing. However, there is nothing stopping you from creating a plain old
Java collection in Clojure.
(let [list (ArrayList. '("Fred" "mary" "sue")]
(do
(java.util.Collections/sort list)
list))
Should work.
On Fri
Hmmm, that is weird ... I would expect the sort to throw an exception,
but it seems to complete happily. (If you try it with a vector
instead of a list, it will error).
Anyway, the typical way to do this would be to convert your Clojure
data structure to a mutable Java type first, then convert i
I was trying to use Clojure to verify the behavior some method in
Java.
Namely I wanted to quickly check whether Collections.sort does the
sorting I need.
So I came up with:
(let [list '("1" "KB" "K6" "2" "EÜ" "EZ" "ES")]
(do
(java.util.Collections/sort list)
list))
But since Collect