Re: with-redefs and inlined functions

2011-11-01 Thread Brian Marick
> On Nov 1, 2011, at 11:17 AM, Chas Emerick wrote: > >> FWIW, it doesn't look like `every?` has any inlining: Ah, I see what's actually going on. My mistake. It's good to hear about how to do the inline check. Thanks! - Brian Marick, Artisanal Labrador Now working at http://path11.com Cont

Re: with-redefs and inlined functions

2011-11-01 Thread Chas Emerick
FWIW, it doesn't look like `every?` has any inlining: => (with-redefs [every? (constantly 5)] (every?)) 5 The metadata seems to confirm: => (meta #'every?) {:ns #, :name every?, :arglists ([pred coll]), :added "1.0", :static true, :doc "Returns true if (pred x) is logical true for every x

with-redefs and inlined functions

2011-11-01 Thread Brian Marick
Clojure sometimes inlines functions. `every?` is an example. As a result, you can have a function that uses `every?`, call it like so: (with-redefs [every? (fn [& args] (println "Hi mom!") false)] (function-that-calls-every)) ... and not get the results that the text of the program calls for.