On Jun 28, 2011, at 4:17 PM, Stuart Sierra wrote:

> The protocol method `add-fields` becomes an ordinary Clojure Var.  You can 
> temporarily change its root binding using `with-redefs` in 1.3.


`with-redefs` has no effect on an already-compiled function that uses a 
defrecord-defined function. I would need something that says "O compiler, being 
able to redef functions is actually more important to me right now than 
efficiency, so please emit code that notices redefs in, for example:

(defn indirect-adder [a b]
  (add-fields (MyRecord. a b)))"

I have a kinda-kludgy workaround that does essentially that. It suffices.

-----
Brian Marick, Artisanal Labrador
Contract programming in Ruby and Clojure
Occasional consulting on Agile
www.exampler.com, www.twitter.com/marick

-- 
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

Reply via email to