I'm attempting to proxy PersistentHashmap so that "get"ting an existing key 
or its reverse returns the same value.

Here's the code that I have

(defn sym-key-hash-map []
  (proxy [clojure.lang.PersistentHashMap] [nil 0 nil false nil]
    (valAt [key]
           (or (proxy-super valAt key)
               (proxy-super valAt (reverse key))))))

(let [key (list 1 2)]
  (get (assoc (sym-key-hash-map) key "sweet")
       (reverse key)))

But unfortunately, the test code returns nil instead of "sweet".

Does anyone with knowledge of proxy and PersistentHashmap know how to solve 
this?

Thanks.

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to