Re: merge doesn't work on deftypes implementing IPersistentMap

2009-12-30 Thread Allen Rohner
> i'm hoping the "yet" part means it is slated to maybe someday be upgraded? I've filed a bug and submitted a patch. Assuming my fix is acceptable, this should be in soon. https://www.assembla.com/spaces/clojure/tickets/231-deftype-cons-doesn-t-support-maps- -- You received this message because

Re: merge doesn't work on deftypes implementing IPersistentMap

2009-12-29 Thread Raoul Duke
>> This seems like a bug to me. Is it? > As we discussed in #clojure IRC, conj for deftypes does not yet > support all the flexibility of conj for e.g. hash-maps, in particular, > the conjing of another map. It does support vectors and map entries. i'm hoping the "yet" part means it is slated to

Re: merge doesn't work on deftypes implementing IPersistentMap

2009-12-29 Thread Rich Hickey
On Mon, Dec 28, 2009 at 10:37 PM, Allen Rohner wrote: > I tried to call merge on a deftype implementing IPersistentMap, and > got an exception: > > user> (deftype Foo [a b] clojure.lang.IPersistentMap) > #'user/Foo > > user> (Foo 1 2) > #:Foo{:a 1, :b 2} > user> (merge (Foo 1 2) {:a 3}) > ; Evalua

merge doesn't work on deftypes implementing IPersistentMap

2009-12-28 Thread Allen Rohner
I tried to call merge on a deftype implementing IPersistentMap, and got an exception: user> (deftype Foo [a b] clojure.lang.IPersistentMap) #'user/Foo user> (Foo 1 2) #:Foo{:a 1, :b 2} user> (merge (Foo 1 2) {:a 3}) ; Evaluation aborted. nth not supported on this type: PersistentArrayMap [Thro