Are you using the release version of 1.2.0? I get the behavior you describe when I use a snapshot of 1.2.0 from when I built from source, but when I use lein repl in a project with a dependency on 1.2.0, all three forms fail with the same exception.
On Sep 8, 9:44 am, Nicolas Oury <nicolas.o...@gmail.com> wrote: > Dear all, > > Clojure 1.2.0 > > (deftype A [ ^{:unsynchronized-mutable true} foo ] > Object > (hashCode > [x] (set! foo :foo) > > 5 > > )) > > works very nicely. > > (deftype A [ ^{:unsynchronized-mutable true} foo ] > Object > (hashCode > [x] (try (set! foo :foo)) > > )) > > also works. > > (deftype A [ ^{:unsynchronized-mutable true} foo ] > Object > (hashCode > [x] (try (set! foo :foo)) > 4 > )) > > fails: > > Cannot assign to non-mutable: foo > [Thrown class java.lang.IllegalArgumentException] > > This is less useless than it seems. (try is called within locking, > which can be useful when setting something unsynchronized) > > Is it a known bug? Does it happen to other people than me? > > Best regards, > > Nicolas. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en